Building up security policies in Ansible

If we were to proceed precisely as we did in the previous section, then when it comes to section 5.2.9 of the RHEL 7 CIS Benchmark version 2.2.0 (Ensure SSH PermitEmptyPasswords is disabled), we would create a new role called rhel7cis_recommendation529 and put the relevant tasks and handlers inside it.

I'm sure that you will be able to see that this does not scale well the creation of a new role means we need to specify it in our top-level playbook, which would look something like the following:

---- name: Test and implement CIS benchmark  hosts: all  become: yes  roles:    - rhel7cis_recommendation528    - rhel7cis_recommendation529

Having one role per line, with almost 400 roles to include, would quickly ...

Get Hands-On Enterprise Automation on Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.