2017-04-03 72 views
0

是否有可能/有效期爲以下形式無業遊民ansible供應方運行不止一個劇本:流浪:多個劇本爲ansible供應者

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 

回答

2

沒有也不會有效

如果您想要運行2個playbook,你需要運行兩次,這可以像

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