From d6ead42b8fe48efaec2b61e26a7584cb5a636e06 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 13 Dec 2017 12:48:46 +0000 Subject: [PATCH] tasks: Add missing tags for async tasks When running the role using a specific tag (eg -t auth), some tasks try to check the status of the async ones and they fail because the async task was never executed due to missing the 'always' tag. We can fix that by adding the missing tags to the async tasks. For example, TASK [ansible-hardening : Remove .shosts or shosts.equiv files] ****************************************************************************************************************************** fatal: [localhost]: FAILED! => {"failed": true, "msg": "'job_result' is undefined"} So we add the appropriate tags to the async tasks. Change-Id: I24a23fb485f2269ae6f627533b3a725f6699d230 --- tasks/rhel7stig/async_tasks.yml | 8 ++++++++ tasks/rhel7stig/auth.yml | 5 +++++ tasks/rhel7stig/rpm.yml | 4 ++++ tasks/rhel7stig/zypper.yml | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/tasks/rhel7stig/async_tasks.yml b/tasks/rhel7stig/async_tasks.yml index a73b2112..423d4c7f 100644 --- a/tasks/rhel7stig/async_tasks.yml +++ b/tasks/rhel7stig/async_tasks.yml @@ -28,6 +28,9 @@ - not check_mode | bool - ansible_os_family | lower in ['redhat', 'suse'] tags: + - rpm + - high + - V-71855 - skip_ansible_lint - name: Check for .shosts or shosts.equiv files @@ -43,3 +46,8 @@ when: - not check_mode | bool - security_rhel7_remove_shosts_files | bool + tags: + - high + - auth + - V-72277 + - V-72279 diff --git a/tasks/rhel7stig/auth.yml b/tasks/rhel7stig/auth.yml index 3687af19..b2d6bcdd 100644 --- a/tasks/rhel7stig/auth.yml +++ b/tasks/rhel7stig/auth.yml @@ -236,6 +236,11 @@ retries: 30 when: - not shosts_find | skipped + tags: + - high + - auth + - V-72277 + - V-72279 - name: Remove .shosts or shosts.equiv files file: diff --git a/tasks/rhel7stig/rpm.yml b/tasks/rhel7stig/rpm.yml index f86c6968..db969358 100644 --- a/tasks/rhel7stig/rpm.yml +++ b/tasks/rhel7stig/rpm.yml @@ -23,6 +23,10 @@ retries: 30 when: - not rpmverify_task | skipped + tags: + - rpm + - high + - V-71855 - name: V-71855 - Get files with invalid checksums (rpm) shell: "grep '^..5' {{ temp_dir }}/rpmverify.txt | awk '{ print $NF }'" diff --git a/tasks/rhel7stig/zypper.yml b/tasks/rhel7stig/zypper.yml index bae858d0..5d4534fb 100644 --- a/tasks/rhel7stig/zypper.yml +++ b/tasks/rhel7stig/zypper.yml @@ -24,6 +24,10 @@ retries: 30 when: - not rpmverify_task | skipped + tags: + - rpm + - high + - V-71855 - name: V-71855 - Get files with invalid checksums (rpm) shell: "grep '^..5' {{ temp_dir }}/rpmverify.txt | awk '{ print $NF }'"