×
Find plugins

Ansible0.6.2Minimum Jenkins requirement: 1.596.1ID: ansible

This plugin allows to execute Ansible tasks as a job build step.

Screenshots

Configuration

After the plugin installation, Jenkins has to be configured. Go to the Jenkins global configuration and find the Ansible section. Click on Add Ansible to add new Ansible installation.
Fill up the fields:

Field name

Description

Name

This is a symbolic name used to identify a specific ansible installation when multiple installations are configured

Path to ansible executable directory

This is the directory where are installed the ansible and ansible-playbook binaries

Authentication with password

Even if using SSH keys is the recommended authentication method between the jenkins node running ansible, authentication with password may sometimes be required. Since version 0.3 the plugin supports password based authentication with sshpass. When using password based authentication, the sshpass binary is expected to be in the PATH. 

sshpass is available for Linux and OSX.

Using Jenkins Build and Environment Variables

It is possible to access build and environment variables in ansible playbooks. These variables are injected as environment variables within the ansible process. For example, use this code in an ansible playbook to access Jenkins BUILD_TAG variable.

playbook.yam
---
- hosts: example
  tasks:
    - debug: msg="{{ lookup('env','BUILD_TAG') }}"

Open Issues

T Key Summary Assignee Reporter Status Created
Loading...
Refresh

Changelog

Version 0.6.2 (3 Jan 2017)

Version 0.6.1 (1 Jan 2017)

  • Use latest parent project definition in order to deploy plugin (thanks to alecharp for the help and the PR)

Version 0.6 (31 Dec 2016)

WARN: 0.6.x version will be the last one to support Jenkins 1.xxx and Ansible 1.x - The 0.7.x and next releases will require Jenkins 2.32.1 (or higher) and Ansible 2.2 (or higher)

  • Add a "do not specify" option for inventory [JENKINS-34627]
  • Support inventoryContent in pipeline (thanks to leewin12 for the PR)
  • Add support of extra variables in jobdsl (thanks to pawbur for the PR)
  • Support empty forks (number of parallel processes) parameter [JENKINS-39438]
  • Escape '%' character in private key path (thanks to ewollesen for the PR) 
  • Omit ansible option when expanded environment variable is empty (thanks to vjestin for the PR) 
  • Add the --forks parameter configurable in pipeline step (thanks to anguswilliams for the PR)
  • Fix usage of environment variable in ansiblePlaybook pipeline step (thanks to thomasKalmar and barthorre for the PR) [JENKINS-38289]

Version 0.5 (5 May 2016) 

  • Add support for ansible extra variables [JENKINS-29863]
  • Improve Pipeline plugin integration [JENKINS-32911]
  • Add the possibility to use the default inventory file (thanks to Johann Schmitz for the PR)
  • Add colorized output in pipeline jobs (thanks to Kirill Merkushev for the PR)
  • Make Jenkins build variables available as environment variables for ansible (thanks to Kevin Mooney for the PR) [JENKINS-29284]

Version 0.4 (25 December 2015) 

  • Support for password protected SSH keys [JENKINS-30656]
  • Initial support for the workflow plugin [JENKINS-30398]
  • Add support for Job DSL plugin (thanks to Kirill Merkushev for the PR) [JENKINS-31790]

Version 0.3.1 (15 July 2015) 

Version 0.3 (20 June 2015) 

  • Add support for password based SSH authentication (with sshpass)
  • Environment variables can be used in Module and Module arguments text field in Ad-hoc command builder
  • Environment variables can be used in inline inventory text box [JENKINS-28547]

Version 0.2 (11 May 2015) 

  • Fix NullPointerException when no credentials are selected
  • Fix --skippedTags parameter configuration which was ignored
  • Fix NullPointerException and print an error message in the build console when the inventory is not set in the job configuration

Version 0.1 (01 May 2015)

  • Initial version
ArchivesGet past versions
Labels