Vagrant setup for the gnuviechadmin suite. This uses the gvasalt repository for Saltstack state and pillar configuration.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
7.8KB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. system("scripts/pregen_keys.sh")
  4. Vagrant.configure("2") do |config|
  5. config.vm.box = "debian/buster64"
  6. config.vm.post_up_message = nil
  7. config.vm.synced_folder ".", "/vagrant", disabled: true
  8. config.vm.provision :shell,
  9. path: "scripts/change-vmdebootstrap-default-dhcp.sh"
  10. #config.vm.provision "shell",
  11. # inline: "sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile"
  12. config.vm.provision "shell",
  13. path: "scripts/add_salt_to_etc_hosts.sh"
  14. config.vm.define "salt" do |node|
  15. node.vm.hostname = "salt"
  16. node.vm.synced_folder "../gvasalt/states", "/srv/salt"
  17. node.vm.synced_folder "../gvasalt/pillar", "/srv/pillar"
  18. node.vm.network "private_network", ip: "172.16.4.10"
  19. node.vm.provider :libvirt do |libvirt|
  20. libvirt.memory = 1024
  21. end
  22. node.vm.provision :salt do |salt|
  23. salt.bootstrap_options = "-x python3"
  24. salt.grains_config = "salt/grains/salt"
  25. salt.install_master = true
  26. salt.masterless = false
  27. salt.minion_id = "salt"
  28. salt.run_highstate = false
  29. salt.minion_key = "salt/keys/salt.pem"
  30. salt.minion_pub = "salt/keys/salt.pub"
  31. salt.seed_master = {
  32. dns: "salt/keys/dns.pub",
  33. file: "salt/keys/file.pub",
  34. ldap: "salt/keys/ldap.pub",
  35. mail: "salt/keys/mail.pub",
  36. mq: "salt/keys/mq.pub",
  37. mysql: "salt/keys/mysql.pub",
  38. pgsql: "salt/keys/pgsql.pub",
  39. salt: "salt/keys/salt.pub",
  40. service: "salt/keys/service.pub",
  41. syslog: "salt/keys/syslog.pub",
  42. web: "salt/keys/web.pub",
  43. }
  44. end
  45. end
  46. config.vm.define "mq" do |node|
  47. node.vm.hostname = "mq"
  48. node.vm.network "private_network", ip: "172.16.4.20"
  49. node.vm.provider :libvirt do |libvirt|
  50. libvirt.memory = 1024
  51. end
  52. node.vm.provision :salt do |salt|
  53. salt.bootstrap_options = "-x python3"
  54. salt.grains_config = "salt/grains/mq"
  55. salt.masterless = false
  56. salt.minion_id = "mq"
  57. salt.minion_key = "salt/keys/mq.pem"
  58. salt.minion_pub = "salt/keys/mq.pub"
  59. salt.run_highstate = false
  60. end
  61. end
  62. config.vm.define "syslog" do |node|
  63. node.vm.hostname = "syslog"
  64. node.vm.network "private_network", ip: "172.16.4.30"
  65. node.vm.provider :libvirt do |libvirt|
  66. libvirt.memory = 1024
  67. end
  68. node.vm.provision :salt do |salt|
  69. salt.bootstrap_options = "-x python3"
  70. salt.grains_config = "salt/grains/syslog"
  71. salt.masterless = false
  72. salt.minion_id = "syslog"
  73. salt.minion_key = "salt/keys/syslog.pem"
  74. salt.minion_pub = "salt/keys/syslog.pub"
  75. salt.run_highstate = false
  76. end
  77. end
  78. config.vm.define "pgsql" do |node|
  79. node.vm.hostname = "pgsql"
  80. #node.vm.synced_folder "repos/gvapgsql", "/srv/gvapgsql"
  81. node.vm.network "private_network", ip: "172.16.4.40"
  82. node.vm.provider :libvirt do |libvirt|
  83. libvirt.memory = 1024
  84. end
  85. node.vm.provision :salt do |salt|
  86. salt.bootstrap_options = "-x python3"
  87. salt.grains_config = "salt/grains/pgsql"
  88. salt.masterless = false
  89. salt.minion_id = "pgsql"
  90. salt.minion_key = "salt/keys/pgsql.pem"
  91. salt.minion_pub = "salt/keys/pgsql.pub"
  92. salt.run_highstate = false
  93. end
  94. end
  95. config.vm.define "dns" do |node|
  96. node.vm.hostname = "dns"
  97. node.vm.network "private_network", ip: "172.16.4.50"
  98. node.vm.provider :libvirt do |libvirt|
  99. libvirt.memory = 1024
  100. end
  101. node.vm.provision :salt do |salt|
  102. salt.bootstrap_options = "-x python3"
  103. salt.grains_config = "salt/grains/dns"
  104. salt.masterless = false
  105. salt.minion_id = "dns"
  106. salt.minion_key = "salt/keys/dns.pem"
  107. salt.minion_pub = "salt/keys/dns.pub"
  108. salt.run_highstate = false
  109. end
  110. end
  111. config.vm.define "ldap" do |node|
  112. node.vm.hostname = "ldap"
  113. #node.vm.synced_folder "repos/gvaldap", "/srv/gvaldap"
  114. node.vm.network "private_network", ip: "172.16.4.60"
  115. node.vm.provider :libvirt do |libvirt|
  116. libvirt.memory = 1024
  117. end
  118. node.vm.provision :salt do |salt|
  119. salt.bootstrap_options = "-x python3"
  120. salt.grains_config = "salt/grains/ldap"
  121. salt.masterless = false
  122. salt.minion_id = "ldap"
  123. salt.minion_key = "salt/keys/ldap.pem"
  124. salt.minion_pub = "salt/keys/ldap.pub"
  125. salt.run_highstate = false
  126. end
  127. end
  128. config.vm.define "file" do |node|
  129. node.vm.hostname = "file"
  130. #node.vm.synced_folder "repos/gvafile", "/srv/gvafile"
  131. node.vm.network "private_network", ip: "172.16.4.70"
  132. node.vm.provider :libvirt do |libvirt|
  133. libvirt.memory = 1024
  134. end
  135. node.vm.provision :salt do |salt|
  136. salt.bootstrap_options = "-x python3"
  137. salt.grains_config = "salt/grains/file"
  138. salt.masterless = false
  139. salt.minion_id = "file"
  140. salt.minion_key = "salt/keys/file.pem"
  141. salt.minion_pub = "salt/keys/file.pub"
  142. salt.run_highstate = false
  143. end
  144. end
  145. config.vm.define "mail" do |node|
  146. node.vm.hostname = "mail"
  147. node.vm.network "private_network", ip: "172.16.4.80"
  148. node.vm.provider :libvirt do |libvirt|
  149. libvirt.memory = 1024
  150. end
  151. node.vm.provision :salt do |salt|
  152. salt.bootstrap_options = "-x python3"
  153. salt.grains_config = "salt/grains/mail"
  154. salt.masterless = false
  155. salt.minion_id = "mail"
  156. salt.minion_key = "salt/keys/mail.pem"
  157. salt.minion_pub = "salt/keys/mail.pub"
  158. salt.run_highstate = false
  159. end
  160. end
  161. config.vm.define "mysql" do |node|
  162. node.vm.hostname = "mysql"
  163. #node.vm.synced_folder "repos/gvamysql", "/srv/gvamysql"
  164. node.vm.network "private_network", ip: "172.16.4.90"
  165. node.vm.provider :libvirt do |libvirt|
  166. libvirt.memory = 1024
  167. end
  168. node.vm.provision :salt do |salt|
  169. salt.bootstrap_options = "-x python3"
  170. salt.grains_config = "salt/grains/mysql"
  171. salt.masterless = false
  172. salt.minion_id = "mysql"
  173. salt.minion_key = "salt/keys/mysql.pem"
  174. salt.minion_pub = "salt/keys/mysql.pub"
  175. salt.run_highstate = false
  176. end
  177. end
  178. config.vm.define "web" do |node|
  179. node.vm.hostname = "web"
  180. #node.vm.synced_folder "repos/gvaweb", "/srv/gvaweb"
  181. node.vm.network "private_network", ip: "172.16.4.100"
  182. node.vm.provider :libvirt do |libvirt|
  183. libvirt.memory = 1024
  184. end
  185. node.vm.provision :salt do |salt|
  186. salt.bootstrap_options = "-x python3"
  187. salt.grains_config = "salt/grains/web"
  188. salt.masterless = false
  189. salt.minion_id = "web"
  190. salt.minion_key = "salt/keys/web.pem"
  191. salt.minion_pub = "salt/keys/web.pub"
  192. salt.run_highstate = false
  193. end
  194. end
  195. config.vm.define "service" do |node|
  196. node.vm.hostname = "service"
  197. #node.vm.synced_folder "repos/gva", "/srv/gva"
  198. node.vm.network "forwarded_port", guest: 443, host:8443
  199. node.vm.network "private_network", ip: "172.16.4.110"
  200. node.vm.post_up_message = "Use https://localhost:8443/ to access the gva web interface"
  201. node.vm.provider :libvirt do |libvirt|
  202. libvirt.memory = 1024
  203. end
  204. node.vm.provision :salt do |salt|
  205. salt.bootstrap_options = "-x python3"
  206. salt.grains_config = "salt/grains/service"
  207. salt.masterless = false
  208. salt.minion_id = "service"
  209. salt.minion_key = "salt/keys/service.pem"
  210. salt.minion_pub = "salt/keys/service.pub"
  211. salt.run_highstate = false
  212. end
  213. end
  214. end