Integrating Ansible roles with tower
So far, we have just executed ad-hoc commands, however, the real strength of Ansible lies in playbooks. Ansible allows us to add multiple Ansible code bases (playbooks, roles, variables, and so on). While Ansible Tower supports keeping the Ansible code in the Ansible Tower server's project directory, it is a practice that we would like to discourage. We strongly recommend using a version control system like Git for keeping Ansible code. For our example, we would use GitHub.
Let us integrate our GitHub repository (https://github.com/ansible-cookbook/ansible-tower-example.git) in Ansible Tower.
How to do it...
Executing playbooks from a Git repository involves two steps: first, we create a project, and then we create a template to execute the playbooks from the project. Let's start with creating a project:
- Go to the
PROJECTS
tab from the top navigation bar. ADemo Project
has already been created for our convenience. - Here, we need to click on the
+ADD
button...