Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 1.58 KB

README.md

File metadata and controls

60 lines (48 loc) · 1.58 KB

Jenkins Ansible Tower Plugin

This plugin gives you the ability to run Ansible Tower jobs as a build step.

Jenkins Wiki page: TBD

Configuration

On the Jenkins => Manage Jenkins => Configure System you will find an Ansible Tower section where you can add a connection to an Ansible Tower server.

Pipeline support

Tower jobs can be executed from workflow scripts. The towerServer and jobTemplate are the only required parameters. G

steps {
        ansibleTower(
            towerServer: 'Prod Tower',
            jobTemplate: 'Simple Test',
            importTowerLogs: true,
            inventory: 'Demo Inventory',
            jobTags: '',
            limit: '',
            removeColor: false,
            verbose: true,
            credential: '',
            extraVars: '''---
my_var: "Jenkins Test"'''
        )
}

Colorized Console Log

You need to install the AnsiColor plugin to output a colorized Ansible log.

node {
    wrap([$class: 'AnsiColorBuildWrapper', colorMapName: "xterm"]) {
        ansibleTower(
            towerServer: 'Prod Tower',
            jobTemplate: 'Simple Test',
            importTowerLogs: true,
            inventory: 'Demo Inventory',
            jobTags: '',
            limit: '',
            removeColor: false,
            verbose: true,
            credential: '',
            extraVars: '''---
my_var: "Jenkins Test"'''
        )
    }
}

If you dont have AnsiColor or want to remove the color from the log set removeColor: true.