We are going to split the playbook into a few different roles. Unlike previous chapters, we are going to make a few of the roles reusable and pass parameters to them as they are executed. Our first role is a simple one, which installs the packages we need to run our OpenSCAP scan.
The playbook
Install role
As mentioned previously, this first role is a simple one that installs the packages we need to run a scan:
$ ansible-galaxy init roles/install
There are a few defaults we need to set in roles/install/defaults/main.yml; these are:
install:
packages:
- "openscap-scanner"
- "scap-security-guide"
There is a task in roles/install/tasks/main.yml that installs the packages and also performs a yum update...