Ansible: In a playbook, filter a role by tag(s) without passing at the command-line

后端 未结 2 1211
醉话见心
醉话见心 2021-02-05 00:08

In Ansible 1.7, I can use --tags from the command-line to only run a subset of that playbooks tasks.

But I\'m wanting to bake into my playbook to run a set of roles wit

2条回答
  •  误落风尘
    2021-02-05 00:18

    You only have the following options with the current version of Ansible:

    1. Specify the tags on the command line
    2. Use a variable instead of a tag to conditionally run tasks
    3. Split your webserver role into multiple roles and use role dependencies for the common tasks

    This feature request has come up on the mailing list a few times and I haven't seen any indication from the dev team that it will be added as a new feature.

提交回复
热议问题