• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

UnixArena

  • Home
  • kubernetes
  • DevOps
    • Terraform
    • Jenkins
    • Docker
    • Openshift
      • OKD
    • Ansible engine
    • Ansible Tower
      • AWX
    • Puppet
  • Cloud
    • Azure
    • AWS
    • Openstack
    • Docker
  • VMware
    • vCloud Director
    • VMware-Guests
    • Vcenter Appliance 5.5
    • vC OPS
    • VMware SDDC
    • VMware vSphere 5.x
      • vSphere Network
      • vSphere DS
      • vShield Suite
    • VMware vSphere 6.0
    • VSAN
    • VMware Free Tools
  • Backup
    • Vembu BDR
    • Veeam
    • Nakivo
    • Azure Backup
    • Altaro VMBackup
    • Spinbackup
  • Tutorials
    • Openstack Tutorial
    • Openstack Beginner’s Guide
    • VXVM-Training
    • ZFS-Tutorials
    • NetApp cDot
    • LVM
    • Cisco UCS
    • LDOM
    • Oracle VM for x86
  • Linux
    • How to Articles
    • Q&A
    • Networking
    • RHEL7
  • DevOps Instructor-led Training
  • Contact

Ansible Tower / AWX – Creating SCM Git Project in Ansible

March 11, 2019 By Cloud_Devops 3 Comments

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
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
Create a New SCM project – Ansible AWX

 

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

Git SCM project - Ansible AWX Tower Setup
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
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
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 !!!

Filed Under: Ansible engine, Ansible Tower, Automation, AWX, Configuration Management, DevOps Tagged With: Ansible, Ansible Tower, AWX

Reader Interactions

Comments

  1. Chari says

    June 2, 2020 at 1:34 pm

    Hi All!

    I”m getting below error while. configuring Project in ansible awx for GitLab repository access.

    fatal: unable to access ‘https://$encrypted:$encrypted$pwforge.pathcom/awxprojects/forti-project.git/’: Failed connect to pwforge.pathcom.com:443

    Reply
    • Lingeswaran R says

      June 3, 2020 at 11:40 am

      You might need to use Git token instead of a password.

      Thank you
      Lingesh

      Reply
  2. jonny says

    June 1, 2020 at 12:13 am

    This would be more useful if the source for the files in your oc_deploy_automation were available. With the content as it is we have to guess hwo it is structured.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow UnixArena

  • Facebook
  • LinkedIn
  • Twitter

Copyright © 2025 · UnixArena ·

Go to mobile version