From 39507838e668e9af0cc2ef314901af051fd9b467 Mon Sep 17 00:00:00 2001 From: Mark Bolwell Date: Fri, 21 Feb 2025 11:15:52 +0000 Subject: [PATCH] added workaround for ssh-server patching breaks /run/ssh Signed-off-by: Mark Bolwell --- tasks/section_1/cis_1.2.2.x.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tasks/section_1/cis_1.2.2.x.yml b/tasks/section_1/cis_1.2.2.x.yml index cdf842c..92eb1c7 100644 --- a/tasks/section_1/cis_1.2.2.x.yml +++ b/tasks/section_1/cis_1.2.2.x.yml @@ -9,6 +9,14 @@ - rule_1.2.2.1 - NIST800-53R5_SI-2 - patch - ansible.builtin.package: - name: "*" - state: latest + block: + - name: "1.2.2.1 | PATCH | Ensure updates, patches, and additional security software are installedi | Update" + ansible.builtin.package: + name: "*" + state: latest + register: discovered_pkg_updates + + # Resetting connection as ssh stops if patched reset connection kickstarts it + - name: "1.2.2.1 | PATCH | Ensure updates, patches, and additional security software are installed | reset ansible connection if ssh updated" + when: "'openssh-server' in discovered_pkg_updates.stdout" + ansible.builtin.meta: reset_connection