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.

67 lines
2.0KB

  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. required_plugins = %w( vagrant-hostmanager )
  4. required_plugins.each do |plugin|
  5. exec "vagrant plugin install #{plugin};vagrant #{ARGV.join(" ")}" unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin'
  6. end
  7. Vagrant.configure(2) do |config|
  8. config.vm.box = "ubuntu/trusty64"
  9. if Vagrant.has_plugin?("vagrant-cachier")
  10. config.cache.scope = :box
  11. end
  12. config.hostmanager.enabled = true
  13. config.hostmanager.manage_guest = true
  14. config.hostmanager.include_offline = true
  15. config.vm.provision :shell, inline: "sudo locale-gen en_IE.UTF-8"
  16. (1..3).each do |m|
  17. config.vm.define "min#{m}" do |min|
  18. min.vm.network "private_network", ip: "172.16.199.1#{m}"
  19. min.vm.hostname = "min#{m}"
  20. min.vm.provider "virtualbox" do |vb|
  21. vb.name = "icinga2-min#{m}"
  22. vb.memory = "2048"
  23. end
  24. min.vm.provision :salt do |salt|
  25. salt.minion_config = "conf/minion"
  26. salt.minion_key = "keys/min#{m}.pem"
  27. salt.minion_pub = "keys/min#{m}.pub"
  28. end
  29. end
  30. end
  31. config.vm.define :master do |master|
  32. master.vm.network "private_network", ip: "172.16.199.10"
  33. master.vm.hostname = "salt"
  34. master.vm.synced_folder "../../icinga2", "/srv/formulas/icinga2"
  35. master.vm.synced_folder "../salt", "/srv/salt"
  36. master.vm.synced_folder "../pillar", "/srv/pillar"
  37. master.vm.provider "virtualbox" do |vb|
  38. vb.name = "icinga2-master"
  39. vb.memory = "1024"
  40. end
  41. master.vm.provision :shell, inline: "sudo apt-get install -y python-git python-pip"
  42. master.vm.provision :salt do |salt|
  43. salt.run_highstate = false
  44. salt.install_master = true
  45. #salt.no_minion =
  46. salt.master_config = "conf/master"
  47. salt.master_key = "keys/master.pem"
  48. salt.master_pub = "keys/master.pub"
  49. salt.seed_master = {"min1": "keys/min1.pub",
  50. "min2": "keys/min2.pub",
  51. "min3": "keys/min3.pub"}
  52. end
  53. end
  54. end