Ansible Tower Projects

 

Building a Project

An ansible project requires an Inventory file. An inventory, in the simplest definition, is a list of nodes which a project will run on them. Ultimately for assigning an inventory to a playbook and executing a project, a Template is required. In another word a template is an access point to a project, and it assigns a specific inventory to a specific playbook of a project and runs the project. One or more templates can be assigned to a project and each template calls and executes a single playbook.
Besides inventories, projects and templates, a credential is required for every single project and every single inventory. It is used for securing the connection between a project and an inventory.
 
Inventories:
It is a list of servers which a project will run on them. In some projects like the Build Project, a dynamic inventory is required because when Satellite build a new node and when the node is requesting a provisioning call back, the new created node must exist in the inventory list. That’s why a dynamic inventory is required, and it must be updated automatically from Satellite Server when a node requests a call back provisioning from Ansible Tower.
Before creating an inventory, a credential is required for connecting the dynamic Inventory to the Satellite server:
 
Credentials:
A credential is required for building a dynamic inventory from Satellite:
Credentials à Click “+” à Add Name, Description, and select Organization à Select an appropriate “Credential type” à Save
After a credential is created for a dynamic inventory from Satellite, it’s time to create the inventory:
Inventory à Click “+” à Add Name, Description, and select Organization à Select the “Credential” just created à Save
 
Projects:
A Project is where in an Ansible Tower that access to and manage all pre-created playbooks.
Projects à Click “+” à Add Name and Description, select Organization à Select an appropriate SCM Type à Select “Project Base Path” à Select “Playbook Directory” à Save
 
Templates:
A Template is required for running a playbook from a project using the inventory assigned to that project. In another word a template is the executable version of the project, and it assigns an inventory to the playbook and runs that. One or more templates can be assigned to a project and each template calls and executes a single playbook. A template can also accept extra variables to pass them to the playbook which is assigned to. A template can be limited to and executed on only some specific hosts in an entire inventory. It can also be scheduled.
The most important part is that a template can be set as a call-back-provisioning. By this setting a job id (y) and a config key (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) will be created after Saving the template and these will be used as the parameter for building a node from Host Group in a Satellite Server (Next Chapter à Server Build Automation Project).
Before creating a template, a credential is required for connecting a template to a project:
 
Credentials:
A credential is required for building a template for a project:
Credentials à Click “+” à Add Name, Description, and select Organization à Select an appropriate “Credential type” à Save
After a credential is created for a template, it’s time to create the template:
Templates  à Click “+” à Add Name, Description, and select a Job Type à Select an Inventory à Select a Project à Select a Playbook à Select the Credential which just created à
If this playbook is going to be called by a new built node for provisioning call back:
Check “Allow Provisioning Callbacks” à Click “Generate Host Config Key” à
à Save

 

Running a Project

A job template is a definition and set of parameters for running an Ansible job. Job templates are useful to execute the same job many times. Job templates also encourage the reuse of Ansible playbook content and collaboration between teams. While the REST API allows for the execution of jobs directly, Tower requires that you first create a job template.
Permissions:
Schedules:
Survey: