Configure Jenkins job with Ansible-Jenkins Plugin to setup CI for Ansible playbooks.

Venkata Chitturi
Apr 6, 2017 · 2 min read

In this post I will go through the configuration of Jenkins job with Ansible plugin to automate the Ansible playbook running.

Pre-requisites on Jenkins server:

Install ansible 2.2 and git version greater than 1.7 ,mostly 2.0 or above.

Jenkisn UI Console:

Step 1: Install ansible plugin using Manage Jenkins Plugins console

Step 2: Configure the ansible installation configuration in Jenkins “Global Tool Configuration” as shown in below pic.

Note: Path of the ansible installed in Jenkins can be found with the below command.

/usr/bin/ansible.

Playbook/ansible commands executed correctly when i gave ‘/usr/bin’ in the “path of ansible executable directory”.

step 3: Configure the Jenkins job.

In build step of Jenkins job, select “Invoke Ansible Playbook” and specify the entries of Ansible installation name, playbook path,inventory file path, host subset pattern and the user to execute the command as shown in the below picture.

Note: In host subset entry to limit the group of servers the playbook executed -do not provide quotes as we do in regular playbook command ‘${group}’ /’hostname’. Just provide ${group} /hostname with out quotes.Its the default behavior for jenkins-ansible plugin.

DevOps Process and Tools

We will discuss on DevOps process, Different technologies…

Venkata Chitturi

Written by

DevOps Professional. Passionate on learning, implementing and sharing new things.

DevOps Process and Tools

We will discuss on DevOps process, Different technologies, Tools , OS and where exactly they will be best fitted in Implementing DevOps or CI/CD along with sample examples.

Venkata Chitturi

Written by

DevOps Professional. Passionate on learning, implementing and sharing new things.

DevOps Process and Tools

We will discuss on DevOps process, Different technologies, Tools , OS and where exactly they will be best fitted in Implementing DevOps or CI/CD along with sample examples.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store