Major Hayden 1f557eb3f7 Fix tags
Each task must be tagged, rather than the include statements. Tasks
get skipped unnecessarily when this is broken.

Change-Id: I7e2850bff4d001f2c57c9d186485f012c547e16a
2016-11-07 21:53:18 +00:00

82 lines
2.5 KiB
YAML

---
# Copyright 2016, 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
when:
- not check_mode | bool
- ansible_os_family | lower == 'redhat'
tags:
- always
- skip_ansible_lint
- name: RHEL-07-010020 - Get files with invalid checksums (rpm)
shell: "grep '^..5' {{ temp_dir }}/rpmverify.txt | awk '{ print $NF }'"
register: rhel_07_010020_files
changed_when: False
when:
- not check_mode | bool
- ansible_os_family | lower == 'redhat'
tags:
- rpm
- high
- RHEL-07-010020
- name: RHEL-07-010020 - The cryptographic hash of system files and commands must match vendor values (rpm)
debug:
msg: |
The following files have checksums that differ from the checksum provided
with their package. Each of these should be verified manually to ensure
they have not been modified by an unauthorized user.
{% for filename in rhel_07_010020_files.stdout_lines %}
{{ filename }}
{% endfor %}
when:
- not check_mode | bool
- ansible_os_family | lower == 'redhat'
- rhel_07_010020_files is defined
- rhel_07_010020_files.stdout is defined
tags:
- rpm
- high
- RHEL-07-010020
# This covers RHEL-07-020150, RHEL-07-020151, and RHEL-07-020152.
- name: RHEL-07-020150 - Require digital signatures for all packages
lineinfile:
dest: /etc/yum.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: present
with_items:
- { regexp: "^gpgcheck.*", line: "gpgcheck=1" }
- { regexp: "^localpkg_gpgcheck.*", line: "localpkg_gpgcheck=1" }
- { regexp: "^repo_gpgcheck.*", line: "repo_gpgcheck=1" }
when:
- security_enable_gpgcheck | bool
tags:
- rpm
- high
- RHEL-07-020150
- RHEL-07-020151
- RHEL-07-020152