Ansible: Can I execute role from command line?

前端 未结 7 851
陌清茗
陌清茗 2020-12-07 14:22

Suppose I have a role called \"apache\"

Now I want to execute that role on host 192.168.0.10 from the command line from Ansible host

ansible-playbook         


        
7条回答
  •  再見小時候
    2020-12-07 14:56

    I am not aware of this feature, but you can use tags to just run one role from your playbook.

    roles:
        - {role: 'mysql', tags: 'mysql'}
        - {role: 'apache', tags: 'apache'}
    
    ansible-playbook webserver.yml --tags "apache"
    

提交回复
热议问题