d6ead42b8f
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
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
---
|
|
# Copyright 2017, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Multiple tasks will need the output of RPM verification, so let's do the
|
|
# lookup one time and then grep over the output in subsequent tasks.
|
|
- name: Verify all installed RPM packages
|
|
shell: "rpm -Va > {{ temp_dir }}/rpmverify.txt"
|
|
args:
|
|
warn: no
|
|
failed_when: False
|
|
changed_when: False
|
|
register: rpmverify_task
|
|
async: 300
|
|
poll: 0
|
|
when:
|
|
- 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
|
|
find:
|
|
paths: /
|
|
recurse: yes
|
|
hidden: yes
|
|
patterns: '.shosts,shosts.equiv'
|
|
changed_when: False
|
|
register: shosts_find
|
|
async: 300
|
|
poll: 0
|
|
when:
|
|
- not check_mode | bool
|
|
- security_rhel7_remove_shosts_files | bool
|
|
tags:
|
|
- high
|
|
- auth
|
|
- V-72277
|
|
- V-72279
|