Running the initial scan

Now that we have both the install and scan roles completed, we can run our first scan. The only file we have not covered yet is the site.yml one; this one looks like slightly different to the ones we have been using in other chapters:

---- hosts: scap  gather_facts: true  become: yes  become_method: sudo  vars_files:    - group_vars/common.yml  roles:    - { role: install, tags: [ "scan" ] }    - { role: scan, tags: [ "scan" ], report_name: "01-initial-scan" }

As you can see, we are tagging the roles as well as passing a parameter when running the scan. For now, we are just going to run playbook without using any tags. To run the playbook, issue the following command:

$ ansible-playbook -i production site.yml

This will give us ...

Get Learn Ansible 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.