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

callback: add support for specifying default playbook labels from Ansible configuration #95

Closed
dmsimard opened this issue Nov 29, 2019 · 0 comments
Labels
enhancement plugins Related to the Ansible plugins

Comments

@dmsimard
Copy link
Contributor

What component is this about ?

The ara_default callback

What is the idea ?

Playbook labels are currently set based on the ara_playbook_labels Ansible variable: https://ara.readthedocs.io/en/latest/playbook-names-and-labels.html

In practice, this is done once at the beginning of every play here:

# Load variables to verify if there is anything relevant for ara
play_vars = play._variable_manager.get_vars(play=play)["vars"]
if "ara_playbook_name" in play_vars:
self._set_playbook_name(name=play_vars["ara_playbook_name"])
if "ara_playbook_labels" in play_vars:
self._set_playbook_labels(labels=play_vars["ara_playbook_labels"])

It would be nice to be able to supply a default list of labels from the Ansible configuration instead of Ansible variables. This would allow labels to be applied without needing to specify Ansible variables or modify playbooks. Any labels specified as variables would be added to the default list.

@dmsimard dmsimard added enhancement plugins Related to the Ansible plugins labels Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement plugins Related to the Ansible plugins
Projects
None yet
Development

No branches or pull requests

1 participant