From 7a55ded06c75f8047f63d35c8f295687186104e9 Mon Sep 17 00:00:00 2001 From: Alex Dworjan Date: Thu, 16 Nov 2023 14:04:40 -0500 Subject: [PATCH] corrected loop issue to loop through all CVE --- .ansible-sign/sha256sum.txt | 2 +- .ansible-sign/sha256sum.txt.sig | 22 +++++++++++----------- roles/insights_cve/tasks/main.yml | 7 +++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.ansible-sign/sha256sum.txt b/.ansible-sign/sha256sum.txt index d88a201..94dd573 100644 --- a/.ansible-sign/sha256sum.txt +++ b/.ansible-sign/sha256sum.txt @@ -16,7 +16,7 @@ a8a29037770b73ab1e0ad0f05ae721e6430d7cc732dabbe22320840483fa8080 alertmanager.y b30ff084240d998e18bedf88c056f3b438205fef6bfe22d7e1cd663d83ad191b nodeexporter_stop.yml 8f9129583653af0ef47a35e953bd3a2f8ac996c734f0a84f7418cfebae933bd9 passwd_restore.yml 6a584e1238c230b215f1231a8875aadcac9465af36b54d3bd23e4eb2677acb59 roles/insights_cve/defaults/main.yml -e37413361b0cd14779a47a1f125c918a79b08e71db2b071b234d0171463dc756 roles/insights_cve/tasks/main.yml +05f3b3a208f01a754c5ef96b423a2578ec90aebdd48daf394d51f091f1c7e5e3 roles/insights_cve/tasks/main.yml 1c9a1e26a6953f074315201347d5e1a3070170425b60b8ee0ee1a96de1443107 roles/insights_cve/tasks/remediation.yml 0bf80df4832bf561f376710842e657ac6224d2f84d60b8f1d6abd888f6df3479 roles/insights_cve/templates/pb_generator_body.j2 10831b191942119573948bc7eb9779879207c25a8deb6bc7d1e1153bfdfec3f6 roles/servicenow_ticket/defaults/main.yml diff --git a/.ansible-sign/sha256sum.txt.sig b/.ansible-sign/sha256sum.txt.sig index 317cdb3..0f778e9 100644 --- a/.ansible-sign/sha256sum.txt.sig +++ b/.ansible-sign/sha256sum.txt.sig @@ -1,14 +1,14 @@ -----BEGIN PGP SIGNATURE----- -iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiI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ZY39hqQOZU4LeIG +X3lkgpqAXpneh6vpe8twPVB5FAQsVh2LU+TH8i8yiXTAPOB38YLY5jgSbICyAhsM +3uSFKaTb +=rj+r -----END PGP SIGNATURE----- diff --git a/roles/insights_cve/tasks/main.yml b/roles/insights_cve/tasks/main.yml index 65531a2..e10fc88 100644 --- a/roles/insights_cve/tasks/main.yml +++ b/roles/insights_cve/tasks/main.yml @@ -62,8 +62,7 @@ block: - name: Print out the total number of security CVEs with severity >= 3 for host "{{ insights_adv_target_host }}" ansible.builtin.debug: - msg: "Detected {{ cve_list | length }} security CVEs with severity >= 3 out of {{ hosts_with_cve }} for host {{ insights_adv_target_host }}" - loop: "{{ cve_list }}" + msg: "Detected {{ cve_list | length }} security CVEs with severity >= 3 for host {{ insights_adv_target_host }}" delegate_to: localhost - name: Send notification message via Mattermost on CVE Issue @@ -100,7 +99,7 @@ body_format: json body: "{{ lookup('ansible.builtin.template', 'templates/pb_generator_body.j2') }}" register: pbs_per_host - loop: "{{ cve_list | first | split }}" + loop: "{{ cve_list }}" delegate_to: localhost - name: Launch a project update from Red Hat Insights @@ -112,7 +111,7 @@ - name: Perform remediation tasks using AAP ansible.builtin.include_tasks: remediation.yml - loop: "{{ cve_list | first | split }}" + loop: "{{ cve_list }}" loop_control: index_var: my_idx