-
Bug
-
Resolution: Unresolved
-
Undefined
-
rhel-10.1
-
Yes
-
Low
-
rhel-system-roles
-
0
-
False
-
False
-
-
Yes
-
None
-
None
-
None
-
Bug Fix
-
-
Proposed
-
Unspecified
-
Unspecified
-
Unspecified
-
-
All
-
None
The kernel_settings role is not idempotent on el7. tests_simple_settings.yml fails when it tries to verify idempotence. The bug was introduced when we switched to using the python configobj library to parse and return the kernel_settings tuned conf file. The problem is that el7 uses python2 which uses an unordered dict to store the values, and the Ansible module code does as well.
This isn't an issue on el8 and later - python3 dict by default uses ordering.
The problem is that the data returned by the module is not the same order as in the file, so when the role writes back the data using the template module, the order is different and the role reports changed. This isn't consistent - sometimes the module will preserve the order, but this is not guaranteed.
The simple fix is to sort the keys before or in the template.
The harder fix is to have the module return not a dict but a list of lists of key/value pairs.