Add role name as tag to all basic roles #85
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
renovate
waiting on upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
CCCHH/ansible-infra!85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-basic-tags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sometimes it is quite annoying when developing or debugging a specific part of the configuration to have to run the whole thing. To make things easier, the base set of roles that we use all over the place have been given a tag corresponding to their role name.
9aeedc3e785787a9d7925787a9d7921d54043b8eAny specific reason for adding the tags on a per-task level instead of where the roles get imported?
This seems like a lot of manual tagging, which could result in missing tags slipping through in the future and also doesn't provide tag inheritance, which results in somewhat unintuitive behavior for roles with dependencies.
Because the tag is a detail of the role itself and not a concern of where the role is called. If we would set it where the role is used, the same argument you take can be made for forgetting to set int on a different playbook where the role is used too.
An alernative, less repetitive option would be to do
@lilly wrote in #85 (comment):
Ugh, guess Ansible really gives us no nice option here. Wrapping everything in a block is quite ugly as well, tagging the individual tasks misses dependencies and tagging at the playbook level does indeed result in the mentioned problem.
I guess we should ask ourselves what we are trying to achieve: If our goal is to enable us to only run parts of a complex role then tagging at the task level does indeed seem like the right option, however if our goal is being able to only run parts of a complex playbook, then tagging at the play(book) level does seem more reasonable.
I would say that our goal is to run parts of a playbook. My main use-case is that I'm configuring a specific service on a VM in which case I don't want to run all the
base_configand utility roles.I would then just tag all the plays at the playbook level and keep tagging at the task level for use cases, where we want to enable running only part of a role.
I think this also makes it easier to achieve our goal for this PR as the relevant playbook just needs to be changed instead of multiple roles.
Pull request closed