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

feat: Make all tasks skippable using variables #783

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

fstarkenberg
Copy link
Contributor

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 with manage_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 is true by default. Exception to this are tasks that just out right disable something, such as disable_prelink or disable_apport.

Since all tasks are still true this should not change anything for end-users. The only real change is that I renamed suid_sgid_permissions to manage_suid_sgid_permissions to be more consistent. I'm a bit unsure if I should change automatic_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:

when:
  manage_kernel | default(true)

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.

@konstruktoid
Copy link
Owner

Copy link
Owner

@konstruktoid konstruktoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Added conditional checks for each task to allow skipping based on variable
@fstarkenberg
Copy link
Contributor Author

I was a bit fast with the copy/paste. Think I fixed it now...

@konstruktoid
Copy link
Owner

Thanks!
I'll autogen the docs later.

@konstruktoid konstruktoid merged commit 343dd27 into konstruktoid:master Nov 20, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants