Saturday, 3 October 2020

How to integrate Jenkins to Ansible Tower and Trigger Tower template from jenkins

 Step 1: Install Ansible Tower Plugin

Go to Manage Jenkins---Manage plugin-----Available-----Search for Ansible Tower


Install without Restart.

Step 2 Go to Manage jenkins----Configure System-----Look for Ansible Tower

Enter Name for Server: Ansible AWX Tower

Enter Awx Tower Url and Credentials










Click Test Connection to test the connection, if Successful, proceed to Step 3

Step 3. Create a new Pipeline Job


Go to Pipeline Section

Copy and paste below code in box

node {

    stage('Tower Deploy') {

        ansibleTower(

            towerServer: 'Ansible AWX Tower',

            jobTemplate: 'Demo Job Template'

        )

    }

}

towerServer: Name of Tower Server you configured in step 2

jobTemplate: Name of the template you want to run












Save.... Build Now

Your job should trigger the Tower template



No comments:

Post a Comment