Vagrant.configure("2") do |config|
  (1..3).each do |n|
    config.vm.define "galaxie#{n}" do |define|
      define.ssh.insert_key = false
      config.vm.box = "debian/buster64"
      define.vm.hostname = "galaxie#{n}"
      define.vm.network :private_network, ip: "172.16.1.4#{n}"
      # if you would like to use port forwarding, uncomment the line below
      # define.vm.network :forwarded_port, guest: 5432, host: "543#{n}"

      define.vm.provider :virtualbox do |v|
        v.cpus = 1
        v.memory = 1024
        v.name = "galaxie#{n}"
      end

      if n == 3
        define.vm.provision :ansible do |ansible|
          ansible.limit = "all"
          ansible.playbook = "test_all.yml"
          ansible.inventory_path = "hosts"
#           ansible.host_vars = {
#             "node_1" => {:connection_host => "172.16.1.41", },
#
#             "node_2" => {:connection_host => "172.16.1.42", },
#
#             "node_3" => {:connection_host => "172.16.1.43", }
#           }
          # to enable ansible playbook verbose mode, uncomment the line below
          # ansible.raw_arguments  = ["-vvv"]
        end
      end

    end
  end
end

