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

拜拜、爱过 提交于 2019-12-03 00:55:38

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.

Ava

The use of conditionals can meet your needs.

You can see more information in my answer to another person's similar question here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!