0

Est-il possible/valide pour exécuter plus d'un Playbooks pour un approvisionneur ansible errante sous la forme suivante:Vagrant: plusieurs Playbooks pour ansible approvisionneur

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" 
    d.vm.provision 'ansible' do |ansible| 
     ansible.config_file = 'ansible/ansible.cfg' 
     ansible.playbook = 'ansible/playbook1.yml' 
     ansible.playbook = 'ansible/playbook2.yml' 
     ansible.sudo = true 
     ansible.inventory_path = 'ansible/inventory/site' 
     ansible.host_key_checking = false 
    end 
    end 

Répondre

2

non ce ne sera pas valide

Si vous voulez exécuter 2 playbook, vous devez exécuter deux fois le provisionneur ansible, cela peut être fait comme

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" 

    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 

    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