-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add Support for --system
Option in Sysctl Module
#544
base: main
Are you sure you want to change the base?
Conversation
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 47s |
What is the status of this PR? I am also at that point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! :)
As far as I know, sysctl
module adds or removes the sysctl parameters specified by the name
parameter (which is required) to/from the configuration file specified by sysctl_file
, and if the reload option is set to true, it will reload the file.
The system_wide
option in this PR reloads not only the modified file but other files as well. Is this functionality truly necessary?
If the intention is simply to reload all configuration files, similar to sysctl --system
, I believe it would be necessary to change the name
parameter from required to optional.
From the ubuntu man page:
|
@MubashirUsman
As mentioned in the man page you pointed out, |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 5m 29s |
I needed to reload two files in different directories and had to use the shell module, |
Same approach here. Was setting up a kubernetes Cluster. |
@MubashirUsman @MaKaNu thank you for your valuable feedback :) @MubashirUsman could you add some integration tests for this change and create a changelog/fragments file?
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 54s |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 45s |
SUMMARY
Sysctl module does not currently support the
--system
option, which loads the configuration files from directories in the following order./etc/sysctl.d/*.conf
/run/sysctl.d/*.conf
/usr/local/lib/sysctl.d/*.conf
/usr/lib/sysctl.d/*.conf
/lib/sysctl.d/*.conf
/etc/sysctl.conf
I defined
SYSCTL_DIRS
, list of directories to iterate over ifsystem_wide
parameter is set to true. It acts same assysctl -p <config-file>
, and goes over all the paths defined inSYSCTL_DIRS
.Fixes #512
ISSUE TYPE
COMPONENT NAME
ansible.posix.sysctl
ADDITIONAL INFORMATION