Salt-config, compliance scan of RHEL machine returns "SLS Rendering Failure: Jinja Error Due to Duplicate gpgcheck Line in /etc/yum.conf"
search cancel

Salt-config, compliance scan of RHEL machine returns "SLS Rendering Failure: Jinja Error Due to Duplicate gpgcheck Line in /etc/yum.conf"

book

Article ID: 405533

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite) VMware SaltStack

Issue/Introduction

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:
  1. 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.
  2. 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.
  3. Verify the fix:
    • Navigate back to RAAS UI > Compliance > Re-run the compliance scan