feat: Make all tasks skippable using variables #783
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to skip the apparmor tasks on some specific hosts but could't find a way to do that without running Ansible with
--skip-tags apparmor
. I noticed that many tasks already have a way to exclude them withmanage_xyz: false
, but not all.So this is my attempt to add it to all tasks. All tasks now have a variable with prefix
manage_
that istrue
by default. Exception to this are tasks that just out right disable something, such asdisable_prelink
ordisable_apport
.Since all tasks are still
true
this should not change anything for end-users. The only real change is that I renamedsuid_sgid_permissions
tomanage_suid_sgid_permissions
to be more consistent. I'm a bit unsure if I should changeautomatic_updates.enabled
to be consistent with this as well, I left it as is for now.Also
This creates a lot of one-line files in
defaults/main
just to enable tasks, another way to do this would be to do something like:I'm personally fine with either way, the way I did it now is a bit more welcoming to moving hardcoded lines in tasks to default vars.