Closed corporate-gadfly closed 3 years ago
That is definitely unexpected! It looks like I missed an edge case during testing.
Slightly different behavior on CentOS 8. No catalog failure. Target file was not touched but each run produces the notice:
Notice: /Stage[main]/Profiles::Sysctl::Common/Sysctl[net.ipv4.ip_forward]/value: changed configuration value from '' to '1'
Target file hasn't been touched:
# ls -al /etc/sysctl.d/01-ipv4.conf
-rw-r--r--. 1 root root 54 Sep 25 2020 /etc/sysctl.d/01-ipv4.conf
Similar behavior on Ubuntu 20.04.3 LTS. Notice on every run:
Notice: /Stage[main]/Profiles::Sysctl::Common/Sysctl[net.ipv4.ip_forward]/value: changed configuration value from '' to '1'
@corporate-gadfly Definitely a weird edge case. Can you try removing any duplicate entries from /etc/sysctl.conf
Good call @trevor-vaughan . There were duplicates in /etc/sysctl.conf
. Now, with duplicates removed. on CentOS 7.9, I'm seeing what I was seeing on CentOS 8 and Ubuntu:
Info: Applying configuration version '1630679211'
Notice: /Stage[main]/Profiles::Sysctl::Common/Sysctl[net.ipv4.ip_forward]/value: changed configuration value from '' to '1'
So, a notice for a non-change every time the catalog runs.
Ideally, 2.6.0 behavior would be preferred, i.e.:
@corporate-gadfly I've identified the edge case and resolved the issue but I'm a bit up in the air about the correct way to implement the solution.
The issues both revolved around having a target set but also having the value specified in a file that would be loaded later (alphabetical and then sysctl.conf).
There are two options:
I don't like the idea of removing it from wherever it was found and then adding it to the file because, technically, it could be specified in multiple files and the last one wins.
I also don't really care for updating both files because, frankly, it's kind of difficult.
CC @op-ct
I think I would go for option 1 (I suppose because of element of least surprise??).
After upgrading to 2.6.1 catalog compilation is failing.
For a class as follows:
I'm getting the following (in debug mode - short snippet):
Output of
sysctl
is:No issues with 2.6.0.