From 9a1ab79199dbf53155815ccb5a364528a8586409 Mon Sep 17 00:00:00 2001 From: Mark Bolwell Date: Mon, 25 Apr 2022 18:29:53 +0100 Subject: [PATCH] updated test Signed-off-by: Mark Bolwell --- tasks/section_1/cis_1.2.x.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/section_1/cis_1.2.x.yml b/tasks/section_1/cis_1.2.x.yml index 23583d5..0023f2d 100644 --- a/tasks/section_1/cis_1.2.x.yml +++ b/tasks/section_1/cis_1.2.x.yml @@ -20,7 +20,8 @@ - skip_ansible_lint # Added as no_log still errors on ansuible-lint - name: "1.2.2 | AUDIT | Ensure GPG keys are configured" - command: gpg --quiet --with-fingerprint "{{ rpm_gpg_key }}" + shell: "PKG=`rpm -qf {{ rpm_gpg_key }}` && rpm -q --queryformat \"%{PACKAGER} %{SIGPGP:pgpsig}\\n\" \"${PKG}\" | grep \"^{{ rpm_packager }}.*Key.ID.{{ rpm_key }}\"" + changed_when: false when: - rhel9cis_rule_1_2_2 - ansible_distribution == "RedHat" or