Site icon UnixArena

Ansible Tower / AWX – Creating SCM Git Project in Ansible

Source Control Management - AWX Ansible Tower

Source Control Management - AWX Ansible Tower

Ansible playbooks and roles must be kept in the Git repositories. Git provides a great mechanism to track the changes in the source code (i.e Playbooks). It also allows playbook developers to create a new branch and work on the codes without impacting the production. Ansible offers an option to pull the new codes on each template run if there are new changes committed in git. Let’s walk through Ansible Tower /AWX – Git SCM project setup and creating the template using that.

 

1. Login to Ansible Tower / AWX console.

 

2. Here is the sample GitLab project which is going to be used to set up the Ansible Project. Playbook will always refer the current directory “roles” directory to find the referred role.

Sample GitLab Project – Repository

 

3. Navigate to the projects tab and click on “+”   in AWX/Ansible Tower console.

Create a New SCM project – Ansible AWX

 

4. Enter the project details and select SCM as git.

Git SCM project – Ansible AWX Tower Setup

 

5. Once you have saved the project, it will try to update it from git SCM.

Project SCM Git – Update – Jobs

 

6. If you create a new template, you could call the playbook from Git SCM.  Here is the sample template by using the Git SCM project.

Create a new template from Git SCM

 

Source control (git or Subversion) based project provides great protection against accidential playbook changes. Hope this article is informative to you.

 

Share it ! Comment it !! Be Sociable !!!

Exit mobile version