Vagrant: multiple playbooks for ansible provisioner
no it will not be valid
If you want to run 2 playbook, you would need to run the ansible provisioner twice, this can be done like
config.vm.define "repo", primary: true do |d|
d.vm.hostname = "some.hostname"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
d.vm.network :private_network, ip: "10.10.2.90"
# First playbook
d.vm.provision "playbook1", type:'ansible' do |ansible|
ansible.config_file = 'ansible/ansible.cfg'
ansible.playbook = 'ansible/playbook1.yml'
ansible.sudo = true
ansible.inventory_path = 'ansible/inventory/site'
ansible.host_key_checking = false
end
# Second playbook
d.vm.provision "playbook2", type:'ansible' do |ansible|
ansible.config_file = 'ansible/ansible.cfg'
ansible.playbook = 'ansible/playbook2.yml'
ansible.sudo = true
ansible.inventory_path = 'ansible/inventory/site'
ansible.host_key_checking = false
end
end