Advertisement
Guest User

Untitled

a guest
Aug 9th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.49 KB | None | 0 0
  1. import "params.pp"
  2. import "classes/authorized_keys.pp"
  3. import "classes/apt_ubuntu_config.pp"
  4. import "roles/*.pp"
  5.  
  6. node common {
  7.  
  8. # Params
  9. class{ "os_params": }
  10.  
  11. # APT repositories
  12. class{ "os_apt_config": }
  13.  
  14. # MySQL Galera
  15. node 'your_server' inherits common {
  16. class { 'os_role_galera':
  17. local_ip => $ipaddress_eth1,
  18. }
  19. }
  20. # HAproxy
  21. node 'your_server', 'your_server', 'your_server' inherits common {
  22. class {"os_role_loadbalancer":
  23. keepalived_interface => "eth1",
  24. keystone => true,
  25. keystone_admin => true,
  26. galera => true,
  27. compute_api => true,
  28. quantum_server => true,
  29. horizon => true,
  30. keepalived_ipvs => [ $os_params::vip_openstack, $os_params::vip_galera, $os_params::vip_midonet ]
  31. }
  32.  
  33. $haproxy_auth = split($os_params::haproxy_auth,":")
  34. }
  35.  
  36. # OpenStack Controllers
  37. node 'your_server', 'your_server' inherits common{
  38.  
  39.  
  40. # Quantum
  41. class{'os_role_quantum':
  42. local_ip => $ipaddress_eth1,
  43. quantum_interface => 'eth1',
  44. }
  45.  
  46. # Nova + Cinder
  47. class{'os_compute_api':
  48. local_ip => $ipaddress_eth1,
  49. }
  50.  
  51. # MySQL Galera
  52. class { 'os_role_galera':
  53. local_ip => $ipaddress_eth1,
  54. }
  55.  
  56. # Keystone
  57. class {"os_role_keystone":
  58. local_ip => $ipaddress_eth1,
  59. }
  60.  
  61. # RabbitMQ
  62. class{'os_role_rabbitmq': }
  63. }
  64.  
  65.  
  66. # OpenStack Compute nodes
  67.  
  68. node 'your_server', 'your_server', 'your_server' inherits common{
  69. class {"os_compute_hypervisor":
  70. local_ip => $ipaddress_eth1
  71. }
  72.  
  73. }
  74.  
  75. node 'your_server', 'your_server', 'your_server', 'your_server' inherits common{
  76. class {"os_compute_hypervisor":
  77. local_ip => $ipaddress_eth0
  78. }
  79.  
  80. }
  81.  
  82.  
  83. # Ceph Storage nodes
  84.  
  85. node 'your_server' inherits common{
  86. if !empty($::ceph_admin_key) {
  87. @@ceph::key { 'admin':
  88. secret => $::ceph_admin_key,
  89. keyring_path => '/etc/ceph/keyring',
  90. }
  91. }
  92. class { 'role_ceph_mon': id => 0 }
  93.  
  94. class { 'ceph::osd' :
  95. public_address => 'eth1',
  96. cluster_address => 'eth1',
  97. }
  98.  
  99. ceph::osd::device { '/dev/sda': }
  100. ceph::osd::device { '/dev/sdb': }
  101. ceph::osd::device { '/dev/sde': }
  102. ceph::osd::device { '/dev/sdf': }
  103.  
  104. # FIXME(fc): extract these values from $os_params::ceph_*_device
  105. ceph_osd_journal { ['sda', 'sdb', 'sde', 'sdf']: }
  106.  
  107. Exec {
  108. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  109. }
  110.  
  111. }
  112.  
  113. node 'your_server' inherits common{
  114. class { 'role_ceph_mon': id => 1 }
  115.  
  116. class { 'ceph::osd' :
  117. public_address => 'eth1',
  118. cluster_address => 'eth1',
  119. }
  120.  
  121. ceph::osd::device { '/dev/sda': }
  122. ceph::osd::device { '/dev/sdb': }
  123. ceph::osd::device { '/dev/sde': }
  124. ceph::osd::device { '/dev/sdf': }
  125.  
  126. Exec {
  127. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  128. }
  129.  
  130. }
  131.  
  132. node 'your_server' inherits common{
  133. class { 'role_ceph_mon': id => 2 }
  134.  
  135. class { 'ceph::osd' :
  136. public_address => 'eth1',
  137. cluster_address => 'eth1',
  138. }
  139.  
  140. ceph::osd::device { '/dev/sda': }
  141. ceph::osd::device { '/dev/sdb': }
  142. ceph::osd::device { '/dev/sde': }
  143. ceph::osd::device { '/dev/sdf': }
  144.  
  145. Exec {
  146. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  147. }
  148.  
  149. }
  150.  
  151. node 'your_server' inherits common{
  152. class { 'role_ceph_mon': id => 3 }
  153.  
  154. class { 'ceph::osd' :
  155. public_address => 'eth1',
  156. cluster_address => 'eth1',
  157. }
  158.  
  159. ceph::osd::device { '/dev/sdb': }
  160. ceph::osd::device { '/dev/sdc': }
  161. ceph::osd::device { '/dev/sdd': }
  162. ceph::osd::device { '/dev/sde': }
  163. ceph::osd::device { '/dev/sdf': }
  164. ceph::osd::device { '/dev/sdg': }
  165. ceph::osd::device { '/dev/sdh': }
  166. ceph::osd::device { '/dev/sdi': }
  167. ceph::osd::device { '/dev/sdj': }
  168. ceph::osd::device { '/dev/sdk': }
  169. ceph::osd::device { '/dev/sdl': }
  170. ceph::osd::device { '/dev/sdm': }
  171. ceph::osd::device { '/dev/sdn': }
  172. ceph::osd::device { '/dev/sdo': }
  173. ceph::osd::device { '/dev/sdp': }
  174.  
  175. Exec {
  176. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  177. }
  178.  
  179. }
  180.  
  181. node 'your_server' inherits common{
  182. class { 'role_ceph_mon': id => 4 }
  183.  
  184. class { 'ceph::osd' :
  185. public_address => 'eth1',
  186. cluster_address => 'eth1',
  187. }
  188.  
  189. ceph::osd::device { '/dev/sdb': }
  190. ceph::osd::device { '/dev/sdc': }
  191. ceph::osd::device { '/dev/sdd': }
  192. ceph::osd::device { '/dev/sde': }
  193. ceph::osd::device { '/dev/sdf': }
  194. ceph::osd::device { '/dev/sdg': }
  195. ceph::osd::device { '/dev/sdh': }
  196. ceph::osd::device { '/dev/sdi': }
  197. ceph::osd::device { '/dev/sdj': }
  198. ceph::osd::device { '/dev/sdk': }
  199. ceph::osd::device { '/dev/sdl': }
  200. ceph::osd::device { '/dev/sdm': }
  201. ceph::osd::device { '/dev/sdn': }
  202. ceph::osd::device { '/dev/sdo': }
  203. ceph::osd::device { '/dev/sdp': }
  204.  
  205. Exec {
  206. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  207. }
  208.  
  209. }
  210.  
  211. node 'your_server' inherits common{
  212. class { 'role_ceph_mon': id => 5 }
  213.  
  214. class { 'ceph::osd' :
  215. public_address => 'eth1',
  216. cluster_address => 'eth1',
  217. }
  218.  
  219. ceph::osd::device { '/dev/sdb': }
  220. ceph::osd::device { '/dev/sdc': }
  221. ceph::osd::device { '/dev/sdd': }
  222. ceph::osd::device { '/dev/sde': }
  223. ceph::osd::device { '/dev/sdf': }
  224. ceph::osd::device { '/dev/sdg': }
  225. ceph::osd::device { '/dev/sdh': }
  226. ceph::osd::device { '/dev/sdi': }
  227. ceph::osd::device { '/dev/sdj': }
  228. ceph::osd::device { '/dev/sdk': }
  229. ceph::osd::device { '/dev/sdl': }
  230. ceph::osd::device { '/dev/sdm': }
  231. ceph::osd::device { '/dev/sdn': }
  232. ceph::osd::device { '/dev/sdo': }
  233. ceph::osd::device { '/dev/sdp': }
  234.  
  235. Exec {
  236. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  237. }
  238.  
  239. }
  240.  
  241. node 'your_server' inherits common{
  242. class { 'role_ceph_mon': id => 6 }
  243.  
  244. class { 'ceph::osd' :
  245. public_address => 'eth1',
  246. cluster_address => 'eth1',
  247. }
  248.  
  249. ceph::osd::device { '/dev/sdb': }
  250. ceph::osd::device { '/dev/sdc': }
  251. ceph::osd::device { '/dev/sdd': }
  252. ceph::osd::device { '/dev/sde': }
  253. ceph::osd::device { '/dev/sdf': }
  254. ceph::osd::device { '/dev/sdg': }
  255. ceph::osd::device { '/dev/sdh': }
  256. ceph::osd::device { '/dev/sdi': }
  257. ceph::osd::device { '/dev/sdj': }
  258. ceph::osd::device { '/dev/sdk': }
  259. ceph::osd::device { '/dev/sdl': }
  260. ceph::osd::device { '/dev/sdm': }
  261. ceph::osd::device { '/dev/sdn': }
  262. ceph::osd::device { '/dev/sdo': }
  263. ceph::osd::device { '/dev/sdp': }
  264.  
  265. Exec {
  266. path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
  267. }
  268.  
  269. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement