Sysctl Template Overwrites symlink to /etc/sysctl.conf
JacobBuskirk opened this issue · 0 comments
Describe the Issue
RHEL 8 has a default file at /etc/sysctl.d/99-sysctl.conf that is a symlink to /etc/sysctl.conf. If this symbolic link is not in place, then values in /etc/sysctl.conf will not be set. If you need the values in this role to have the maximum precedence, then the values should be written into /etc/sysctl.conf, or the module should follow the symlink.
Expected Behavior
The default 99-sysctl.conf symbolic link should not be overwritten.
Actual Behavior
The default 99-sysctl.conf symbolic link is being overwritten.
Control(s) Affected
All sysctl controls
Environment (please complete the following information):
- branch being used: devel
- Ansible Version: 2.14
- Host Python Version: 3.9.16
- Ansible Server Python Version: 3.6.8
- Additional Details:
Additional Notes
This issue can cause problems where users think the settings in /etc/sysctl.conf are being applied, but they're actually not.
Possible Solution
Follow the symlink with the template, or change sysctl tasks to use sysctl module to write individual lines to sysctl.conf. Many users may have settings they want in sysctl.conf, so it may make more sense to remove the template and write each line individually. Alternatively this could be changed to a lower precedence file, like 98-sysctl-stig.conf, although that also may have issues.