2017-04-03 46 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