Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more ways to set tags #204

Open
dberardo-com opened this issue May 26, 2022 · 5 comments
Open

more ways to set tags #204

dberardo-com opened this issue May 26, 2022 · 5 comments

Comments

@dberardo-com
Copy link

currently the only two ways i know of to set tags for current runs are:

  • via command line
  • via the [tags] in the ansible.cfg file

however i would like to have ways to define different tags combinations in better ways and so this could happen via:

  • allowing for merging multiple ansible.cfg files with different [tags] configurations
  • defining tags in inventories --> probably mapping tags to playbook names
  • defining tags in playbook itself (perhaps via variables?) --> the default in ansible is now that all tags are set by default, but one might want to have another "default" tag combination. this could be done now only assigning "never" to tasks that do not have to run by default, but that is not nice
@dberardo-com
Copy link
Author

i add to the above points, that would also be nice to have a possibility to set tags dynamically, like a "set_tags" module

@bcoca
Copy link
Member

bcoca commented May 26, 2022

the part about mergable configs is much bigger than tags and is already in a separate proposal

a set_tags module would be very hard to implement as the engine now filters tags before processing tasks, set_tag would happen after that and would require re-initializing the whole stack.

for most cases, when does a better job of task execution selection, to the point I have many times considered deprecating 'tags'.

@dberardo-com
Copy link
Author

so you are suggesting using when instead of tags ?

@bcoca
Copy link
Member

bcoca commented May 26, 2022

yes

@dberardo-com
Copy link
Author

i see. i will wait for the config merging to be put in place and see if that would do the job, i find tagging quite neat, but let's see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants