Major Hayden
78d37afccc
Manually check apparmor_status
The apparmor systemd unit file simply calls an old SysV init script to load AppArmor profiles. The init script exits and systemd has no idea if it's still running or not. This causes Ansible to start the apparmor unit each time the playbook runs, which breaks the idempotency checks. This patch checks the apparmor_status output directly to see what the status of AppArmor actually is. If the module is loaded, then we should not try to start AppArmor with the unit file again. This patch also includes the updates from the openstack-ansible-tests repository that were included in https://review.openstack.org/#/c/488489/ so that the gate can be unblocked. Partial-Bug: 1710675 Change-Id: If253714d0ca4b5a3d324255751e6f6615ca75dde
ansible-hardening
The ansible-hardening role applies security hardening configurations from the Security Technical Implementation Guide (STIG) to systems running the following distributions:
- CentOS 7
- Debian Jessie
- Fedora 25
- openSUSE Leap 42.2 and 42.3
- Red Hat Enterprise Linux 7
- SUSE Linux Enterprise 12 (experimental)
- Ubuntu 14.04 (deprecated)
- Ubuntu 16.04
For more details, review the ansible-hardening documentation.
Requirements
This role can be used with or without OpenStack-Ansible. It requires Ansible 2.3 or later.
Role Variables
All of the variables for this role are in defaults/main.yml
.
Dependencies
This role has no dependencies.
Example Playbook
Using the role is fairly straightforward:
- hosts: servers
roles:
- ansible-hardening
Running with Vagrant
This role can be tested easily on multiple platforms using Vagrant.
The Vagrantfile
supports testing on:
- Ubuntu 14.04
- Ubuntu 16.04
- CentOS 7
To test on all platforms:
vagrant destroy --force && vagrant up
To test on Ubuntu 14.04 only:
vagrant destroy ubuntu1404 --force && vagrant up ubuntu1404
To test on Ubuntu 16.04 only:
vagrant destroy ubuntu1604 --force && vagrant up ubuntu1604
To test on CentOS 7 only:
vagrant destroy centos7 --force && vagrant up centos7
License
Apache 2.0
Author Information
For more information, join #openstack-ansible
on Freenode.
Description
Languages
Jinja
44.5%
Python
41.2%
Shell
14.3%