Ansible: Can I execute role from command line?

前端 未结 7 825
陌清茗
陌清茗 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:58

    I have written a small Ansible plugin, called auto_tags, that dynamically generates for each role in your playbook a tag of the same name. You can find it here.

    After installing it (instructions are in the gist above) you could then execute a specific role with:

    ansible-playbook -i "192.168.0.10" --tags "name_of_role"

提交回复
热议问题