Security Automation with Ansible 2
上QQ阅读APP看书,第一时间看更新

Ansible Tower configuration

Ansible Tower has multiple features to add playbooks to perform scheduling and execution. We will see how we can add custom written playbooks (manual) and add playbooks from version control systems such as Git. Pulling playbooks from  Ansible Galaxy as well. Ansible Galaxy is your hub for finding, reusing, and sharing the best Ansible content.

To add playbooks into Ansible Tower, we have to start by creating projects, then select the SCM TYPE as Manual, and add the playbooks that already exist.

Warning: There are no available playbook directories in /var/lib/awx/projects. Either that directory is empty, or all of the contents are already assigned to other projects. Create a new directory there and make sure the playbook files can be read by the awx system user, or have Tower directly retrieve your playbooks from source control using the SCM type option previously discussed.

We can choose the SCM TYPE set to Git and provide a github.com URL pointing to a playbook:

Git SCM to add playbooks into projects

We can also change the PROJECTS_ROOT under CONFIGURE TOWER to change this location.

The added playbooks are executed by creating a job template. Then we can schedule these jobs (or) we can launch directly:

Following is the screenshot of a new job template creation for playbook execution:

Playbook execution job template 

A job run is successful with output in the following screenshot:

Playbook execution output in Ansible Tower