when attempting to scan compliance on RHEL machine, the job returns the below error message:
SLS Rendering Failure: Jinja Error Due to Duplicate gpgcheck Line in /etc/yum.conf
....
...
[CRITICAL] Rendering SLS 'sse:locke.system.CIS_Red_Hat.....failed: Jinja error: While reading from '/etc/yum.conf
Environment
Salt-config 8.17.x
Cause
Compliance scan uses configparser library from saltstack for phrasing files. When attempting to phrase the target minion where the scan was attempted, the config file /etc/yum.conf had duplicate sections, in this senario, duplicate property was for "gpgcheck"
Resolution
To resolve this issue, identify and remove the duplicate gpgcheck line from the /etc/yum.conf file on the affected Salt minion(s). Steps to resolve the issue:
Locate the duplicate line:
Access the Salt minion(s) displaying the error.
Inspect the /etc/yum.conf file. Use commands like grep -i gpgcheck /etc/yum.conf to highlight the occurrences of the gpgcheck option.
Remove the duplicate line:
Manually edit the /etc/yum.conf file using a text editor (e.g., vi, nano).
Delete the extraneous gpgcheck line, ensuring that each section of the file contains only a single instance of gpgcheck.
Save the changes.
Verify the fix:
Navigate back to RAAS UI > Compliance > Re-run the compliance scan