From 66814a6f016b55b7c75436c397c8654b966305a3 Mon Sep 17 00:00:00 2001 From: Mark Bolwell Date: Thu, 13 Jan 2022 11:46:13 +0000 Subject: [PATCH] added args warn for shell Signed-off-by: Mark Bolwell --- tasks/main.yml | 2 ++ tasks/post.yml | 4 ++++ tasks/post_remediation_audit.yml | 6 +++++- tasks/pre_remediation_audit.yml | 6 +++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 89e9ffc..29e0a19 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -37,6 +37,8 @@ block: - name: "Check su group exists if defined" shell: grep -w "{{ rhel9cis_sugroup }}" /etc/group + args: + warn: false register: sugroup_exists changed_when: false failed_when: sugroup_exists.rc >= 2 diff --git a/tasks/post.yml b/tasks/post.yml index a3eae23..ec5c5c3 100644 --- a/tasks/post.yml +++ b/tasks/post.yml @@ -8,6 +8,8 @@ - name: trigger update sysctl shell: /bin/true + args: + warn: false changed_when: false check_mode: false notify: update sysctl @@ -30,6 +32,8 @@ - name: trigger update auditd shell: /bin/true + args: + warn: false notify: update auditd changed_when: false check_mode: false diff --git a/tasks/post_remediation_audit.yml b/tasks/post_remediation_audit.yml index 9a14c5c..c1c413f 100644 --- a/tasks/post_remediation_audit.yml +++ b/tasks/post_remediation_audit.yml @@ -2,7 +2,7 @@ - name: "Post Audit | Run post_remediation {{ benchmark }} audit" shell: "{{ audit_conf_dir }}/run_audit.sh -v {{ audit_vars_path }} -o {{ post_audit_outfile }} -g {{ group_names }}" - vars: + args: warn: false - name: Post Audit | ensure audit files readable by users @@ -18,6 +18,8 @@ block: - name: "capture data {{ post_audit_outfile }}" shell: "cat {{ post_audit_outfile }}" + args: + warn: false register: post_audit changed_when: false @@ -33,6 +35,8 @@ block: - name: "Post Audit | capture data {{ post_audit_outfile }}" shell: "tail -2 {{ post_audit_outfile }}" + args: + warn: false register: post_audit changed_when: false diff --git a/tasks/pre_remediation_audit.yml b/tasks/pre_remediation_audit.yml index 2821cd2..4fca3c5 100644 --- a/tasks/pre_remediation_audit.yml +++ b/tasks/pre_remediation_audit.yml @@ -86,13 +86,15 @@ - name: "Pre Audit | Run pre_remediation {{ benchmark }} audit" shell: "{{ audit_conf_dir }}/run_audit.sh -v {{ audit_vars_path }} -o {{ pre_audit_outfile }} -g {{ group_names }}" - vars: + args: warn: false - name: Pre Audit | Capture audit data if json format block: - name: "Pre Audit | capture data {{ pre_audit_outfile }}" shell: "cat {{ pre_audit_outfile }}" + args: + warn: false register: pre_audit changed_when: false @@ -108,6 +110,8 @@ block: - name: "Pre Audit | capture data {{ pre_audit_outfile }}" shell: "tail -2 {{ pre_audit_outfile }}" + args: + warn: false register: pre_audit changed_when: false