This is what a very basic Vagrantfile might look like
# vi: set ft=ruby :
num_machines = 1
itr = [
# "bento/centos-6.7",
# "bento/centos-7.2",
# "bento/debian-8.6",
# "bento/fedora-29",
# "bento/ubuntu-16.10",
"bento/ubuntu-18.04",
# "bento/debian-9"
]
Vagrant.configure(2) do |config|
itr.each_with_index do |os, index|
config.vm.provision "file", source: "package.json", destination:
"package.json"
puts 'xxxxxxxxxxxxxxxxxxxxxxxxx', os
# config.ssh.forward_agent = true
config.vm.define "plu#{index+1}" do |plu|
plu.vm.box = os
plu.vm.box_check_update = true
plu.vm.hostname = "plu#{index+1}"
plu.vm.network "private_network", ip: "192.168.1.9#{index+1}"
plu.vm.provider "virtualbox" do |v|
v.name = "plu#{index+1}"
v.memory = "512"
end
if index == (itr.length-1) then
config.vm.provision "ansible" do |ansible|
ansible.limit = "plu1"
ansible.playbook = "./playbook.yml"
ansible.inventory_path = "inventory"
# ansible.ask_become_pass = true
ansible.raw_arguments = ["--flush-cache"]
ansible.verbose = "-vvvv"
end
end
end
end
end
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/d249bfef-df4a-478f-8360-5256985be050o%40googlegroups.com.