Skip to end of metadata
Go to start of metadata

Plugin Information

View Ansible Tower on the plugin site for more information.

Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:

This plugin connects Jenkins to Ansible Tower, allowing you to execute job templates.


After installing the plugin you can configure Ansible Tower servers in the Jenkins Global Configuration under the section Ansible Tower by clicking the add button.

The fields are as follows:

Field NameDescription
NameThe name that this Ansible Tower installation will be referenced as.
URLThe base URL of the Ansible Tower server.

The credentials within Jenkins to be used to connect to the Ansible Tower server.

  • For basic auth use a "Username with password" type credential
  • For oAuth (starting in Tower 3.3.0) use a "Secret Text" type credential from the Plain Credentials Plugin
    ee the OAuth Authentication section of this document for more details on setting up oAuth.
Force Trust Cert

If your Ansible Tower instance is using an https cert that Jenkins does not trust, and you want the plugin to trust the cert anyway, you can click this box.

You should really understand the implications if you are going to use this option. Its meant for testing purposes only.

Enable Debugging

This will allow the plugin to write detailed messages into the jenkins.log for debugging purposes. It will show show requests to the server and payloads. This can contain a lot of data. All messages are prefixed with \[Ansible-Tower\].

For Example:

[Ansible-Tower] building request to
[Ansible-Tower] Adding auth for admin
[Ansible-Tower] Forcing cert trust
[Ansible-Tower] {"count":4,"next":null ...

Once the settings are completed, you can test the connection between Jenkins and Ansible Tower by clicking on the Test Connection button.

Adding a Build Step

In a freestyle project a new build step called Ansible Tower is now available:

Tower ServerThe predefined Ansible Tower server to run the template on.
Template TypeWhether you are running a job or workflow template.
Template IDThe name or numerical ID of the template to be run on the Ansible Tower server.
Extra Vars

Additional variables to be passed to the job. I.e.:
my_var: This is a variable called my_var 

Job Tags

Any job tags to be passed to Ansible Tower.

Skip Job TagsAny skip tags to be passed to Ansible Tower.
Job TypeIs this a template run or a check.
LimitThe servers to limit the invocation to.
InventoryThe name or numeric ID of the inventory to run the job on.
CredentialThe name or numeric ID of the credentials to run the job with.
VerboseAdd additional messages to the Jenkins console about the job run.
Import Tower OutputPull all of the logs from Ansible Tower into the Jenkins console.
Import Workflow Child OutputPull in the output from all of the jobs that the template runs.
Remove ColorWhen importing the Ansible Tower output, strip off the ansi color codings.

Pipeline support

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

Pipeline Example
node {
    stage('MyStage') {
            towerServer: 'Prod Tower',
            templateType: 'job',
            jobTemplate: 'Simple Test',
            importTowerLogs: true,
            inventory: 'Demo Inventory',
            jobTags: '',
			skipJobTags: '',
            limit: '',
            removeColor: false,
            verbose: true,
            credential: '',
            extraVars: '''---
my_var:  "Jenkins Test"'''

Expanding Env Vars

The fields passed to Tower (jobTemplate, extraVars, limit, jobTags, inventory, credential) can have Jenkins Env Vars placed inside of them and expanded. For example, if you had a job parameter as TAG you could expand that in the Extra Vars like this:

my_var: "$TAG"

Console Color

You need to install another plugin like [AnsiColor plugin]( to output a colorized Ansible log.

Pipeline Example With AnsiColor
node {
	wrap([$class: 'AnsiColorBuildWrapper', colorMapName: "xterm"]) {
			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 do not have a plugin like AnsiColor or want to remove the color from the log set removeColor: true.

OAuth Authentication

Starting in Tower version 3.3.0, Oauth Authentication can be used alongside basic auth. Beginning in Tower version 3.4.0, basic authentication will be disabled.

The Ansible Tower Documentation covers this in detail, but here is a rough outline of what needs to be performed.

Tower Configuration

  1. Add an Application for the Jenkins Oauth tokens
    1. Name (i.e. "Jenkins")
    2. Description (optional)
    3. Organization (The organization which covers the JTs and WFJTs you will be using)
    4. Authorization Grant Type = Resource owner password-based
    5. Client Type = Confidential
  2. Add or create a user to bind to an Oauth token
    1. This should be a service account with limited permissions.
    2. Add a Token for this user with the Users / <Username> / Tokens / Create Token dialogue (with the appropriate scope)
    3. Copy the Token ID which is generated on the prompt.

Jenkins Configuration

  1. Install this plugin (it must be a version >= 0.90)
  2. Add a Credential
    1. Choose the appropriate scope
    2. Secret = Token ID from step 2.c above
    3. ID = Something to denote it's purpose (i.e. "jenkins-tower-token")
    4. Description (optional)
  3. Complete the configuration steps as defined in this guide's 'Configuration'

Returning Data

The plugin supports sending data back to Jenkins as environment variables via the EnvInject plugin. First be sure the plugin is installed (its not a dependency for this plugin, it needs to be installed separately).

If you try to export a variable but don't have the EnvInject plugin installed the Tower plugin will let you know with a message like:

    Found environment variables to inject but the EnvInject plugin was not found

There are two method for exporting data: Purpose Driven Logging and Setting Stats

Purpose Driven Logging

Then, in your Tower job simply include a debugging statement like:

    - name: Set a Jenkins variable

The Tower plugin will recognize this message and use EnvInject plugin to add an environment variable named VAR_NAME with a value of "value" into the pipeline for consumption by downstream tasks.

Setting Stats

Another option is to use the set_stats module in Ansible like:

    - name: Set a jenkins variable for with stat
            - some_name: var_value
            - some_other_var : Another value
        aggregate: yes
        per_host: no

The Tower plugin will look for variables under JENKINS_EXPORT and use EnvInject plugin to add an environment variables into the pipeline for consumption by downstream tasks. In the previous example two variables would be created: some_name, set to var_value; and some_other_var set to "Another value".

Please reference set_stats documentation for usage and additional parameters, per_host and aggregate are not necessarily needed.

Open Issues

Key Summary T Created Updated Due Assignee Reporter P Status Resolution


Version 0.9.2 (Apr-30-2019)

Version 0.9.1 (Dec-02-2018)

My apologies for the delay in getting this fix out. One of the things which took a while to setup was a more robust testing environment. Hopefully issues like the login issues with the last release will be able to be caught before they are released. Thanks the community for all of the help with the following fixes as well as to the Ansible Tower Engineering team for working with me on a better way to achieve the task at hand.

  • Fixing authentication issues. We initially were trying to determine the version number of Tower/AWX and then make a decision on authentication method. We now do it like tower-cli does by checking for /api/v2/o to determine if we need to authenticate with an oAuth token or a legacy token type. Thanks to Lukas Tischler for the Pull Request starting this fix.
  • In addition, we added more logging message when a Tower instance is set to debug as to what is happening with authentication.
  • Fixed some typos in log messages.
  • Fixed issue if you have Force Trust cert enabled but you are connecting to an AWX instance on http.
  • The plugin now attempts to give you more details if it receives a 403 (Unauthorized) from the instance.
  • Fixed an issue where newer versions of Tower failed if credentials were not in integer format. Thanks to James McShane for the Pull Request. [ JENKINS-54503 ]
  • The plugin now returns JOB_ID, JOB_URL and JOB_RESULT back to Jenkins. Thanks to Lukas Tischler for the Pull Request.
  • The plugin can now be configured to not fail a job if a Tower execution fails. Thanks to Lukas Tischler for the Pull Request.

Version 0.9.0 (Sep-25-2018)

  • Added support for oAuth to Tower.
  • Fixed connection issues with Tower 3.3.0 using Basic Auth.

Version 0.8.7 (Jul-23-2018)

  • Fixed URI to authtoken.

Version 0.8.6 (Jul-15-2018)

Version 0.8.5 (Jun-03-2018)

  • Decreased version dependency on EnvInject plugin due to issues. Thanks to Mikael Gaunin for the Pull Request.

Version 0.8.4 (Apr-29-2018)

  • Removed comparable since in pom.xml to prevent warning about invalid config files. [ JENKINS-51009 ] Thanks to Adrien for catching this.

Version 0.8.3 (Apr-13-2018)

Version 0.8.2 (Mar-24-2018)

  • Added help text for template ID. [ JENKINS-50239 ]
  • Notes for extra vars, job tags, limit, inventory and credential now indicate that "Prompt on Launch" in the template is required for the setting to take affect in Tower [ JENKINS-49915 ]

Version 0.8.1 (Mar-10-2018)

  • The connection will now be attempted by an authtoken first, if that fails (like on the new versions of AWX) it will revert to Basic Auth. [ JENKINS-50031 ]

Version 0.8.0 (Feb-18-2018)

  • Mostly changes when interacting with Tower:
    • Added filtered lookups of items by name to reduce time searching through the results and also prevent pagination issues.
    • Plugin now utilizes authtokens after initial login. This should decrease run times when the Tower instance is using an external authenticator (such as LDAP).
    • Changes to the logging to try and prevent pagination issues and also enhance the speed of looking up logs.
  • Contributed code enhancements:
    • Source code spelling fixes. (Josh Soref)
    • Fixes for warning if passing items (such as credentials) but the job template is not prompting for the item. (Josh Offutt)
    • Final check for log entries after the job completes running. (James McShane)

Version 0.7.0 (Jan-02-2018)

  • Fixed an issue with purpose driven logging where ending color codes could have been included in variable values
  • Added debugging option to Tower configuration
  • Added set_stats variable detection for variable export

Version 0.6.1 (Dec-20-2017)

  • Bug fixes for last release (it basically didn't work)
  • Added some checking for passed credentials and inventory (even if an ID is passed)
  • Also tries to give a better error if extra vars are bad

Version 0.6.0 (Dec-12-2017)

  • Allowed returning variables back to Jenkins via logging

Version 0.5.4 (Dec-7-2017)

  • Plugin now reports if you are passing in a value (like job tags) but prompt on launch is not configured for the job template. [ JENKINS-48377 ]
  • Workflows with inventory updates or sum updates no longer fail when pulling logs back into Jenkins. [ JENKINS-48438 ]

Version 0.5.3 (Dec-2-2017)

  • Fixed bug where existing jobs would get NullPointerExceptions when installing the new version of the plugin.

Version 0.5.2 (Dec-2-2017)

  • Added option to specify workflow or job templates
    Thanks again to Alvin Wong for the suggestion. 

Version 0.5.1 (Nov-21-2017)

  • Expanded Jenkins EnvVars in all fields being passed to Tower
    Thanks to Alvin Wong for the suggestion.

Version 0.5.0 (Nov-11-2017)

  • Initial release


  1. Thanks for this!  Do you know of any way to pass in Jenkins build parameters into the plugin? 

    Example: having a Build Parameter of TAG, value: 123, and in the extra_vars section, tag: "{{ TAG }}"

    1. Thanks for the suggestion. A new version of the plugin has been pushed which should handle this. Its uses standard Jenkins syntax so extra_vars will be:
      tag: "$TAG" 

      The update should show up in the next 24 hours. Please let me know if you have any issues.

      1. It works great, thanks a lot!  Also, to anyone who runs into issues with passing in multiple parameters into a single value, it would look like:


        tag: "$TAG1.$TAG2"

  2. Is there any way to extend functionality to specify a workflow template, instead of a job template?  I get the following:

    ERROR: Unable to request job template invocation Unable to find job template: Unable to find item named Example Workflow

    1. There is a new version which allows you to specify the template type as either a job (the default) or workflow. In the future I want to modify the input screen so the fields are dynamic since most of them don't apply when submitting a workflow template.

      The update should show up in the next 24 hours. Please let me know if you have any issues.

      1. I am able to invoke workflow templates now, thanks!

        One issue I am seeing though, is that job tags don't seem to be passing through from Jenkins to AWX.

        1. Is this for a regular job template?

          Also, if you have access, would you mind creating an issue for this in the JIRA board? 

          I want to make sure that the wiki component monitoring JIRA is working correctly.

  3. I would also like to see the ability to specify a workflow template.

    1. All set, please try the new version and let me know if its working for you.

  4. I would like to see some programmatic way to return data from the template execution within the tower template. Perhaps being able to return specified aspects of a playbook run via variable injection back into Jenkins?

  5. Hi
    I am getting next error in my pipeline Jenkins job:

    ERROR: Unable to request job template invocation Tower recieved a bad request (400 response code). This can happen if your extre vars, credentials, inventory, etc are bad

    Here is part of my config:

                                            credential: '',
                                            importTowerLogs: false,
                                            importWorkflowChildLogs: false,
                                            inventory: '123',
                                            jobTags: '',
                                            jobTemplate: '234',
                                            limit: '',
                                            removeColor: false,
                                            templateType: 'job',
                                            towerServer: 'AT PROD',
                                            verbose: false,
                                            extraVars: '''---
                                    FlushCache: "Yes"
                                    RepoURL: "repourl"
                                    InvalidateCloudFront: "No"
                                    InvalidationPaths: "/static/*"
                                    JiraMode: "Autodetect"
                                    JiraTicket: ""
                                    ReleaseType: "Branch"'''

    Could you please advise how to debug the error above?

    1. Alexandr, I've created a ticket for this, you should get an email about it shortly.

      1. Thanks, John.

        You are doing a great work.

        I resolved my issue, by using extra variables like this (just moved every extra variable at the  start of the line):

                                                credential: '',
                                                importTowerLogs: false,
                                                importWorkflowChildLogs: false,
                                                inventory: '123',
                                                jobTags: '',
                                                jobTemplate: '234',
                                                limit: '',
                                                removeColor: false,
                                                templateType: 'job',
                                                towerServer: 'AT PROD',
                                                verbose: false,
                                                extraVars: '''---
        FlushCache: "Yes"
        RepoURL: "repourl"
        InvalidateCloudFront: "No"
        InvalidationPaths: "/static/*"
        JiraMode: "Autodetect"
        JiraTicket: ""
        ReleaseType: "Branch"'''

        And it works well now.

        Anyway, I will try your fix and will give you update.

  6. Hello

    When I am trying to test connection on the configuration page, I am getting next error:

    I see nothing in Jenkins log.

    Could you please help with that?

    P.S.: Recently we upgraded ansible tower to 3.2.2, but I am not sure if its related to that.


    1. Interesting, I've not come across this before. I've created a ticket for you  JENKINS-48835 - Getting issue details... STATUS  and will respond from there.

  7. Hello, 

    I have installed the latest version of Ansible Tower with Jenkins (2.89.3). I am able to execute job from the Jenkins UI successfully. 

    When I try to use the DSL code above:

    steps {
                towerServer: 'Test',
                jobTemplate: 'Simple Test',
                importTowerLogs: true,
                inventory: 'Demo Inventory',
                jobTags: '',
                limit: '',
                removeColor: false,
                verbose: true,
                credential: '',
                extraVars: '''---
    my_var: "Jenkins Test"'''
    I get the following error:
    ERROR: (script, line 64) No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.ansibleTower() is applicable for argument types: (java.util.LinkedHashMap) values: [[towerServer:Test]]


    When I declare only the following, it creates the Ansible Tower piece in my Jenkins job without any issues:

    steps {
    My issue only occurs when I try to populate the ansibleTower job. 
    I have tried changing the syntax many times but I always end up with the same error. 
    Any advice or help would be hugely appreciated. 
    1. Hi Morgan, There was a typo in the wiki. Please try the following and let me know if it works:

      Updated Example
      node {
          wrap([$class: 'AnsiColorBuildWrapper', colorMapName: "xterm"]) {
              stage('MyStage') {
                      towerServer: 'Test',
                      templateType: 'job',
                      jobTemplate: 'Simple Test',
                      importTowerLogs: true,
                      inventory: 'Demo Inventory',
                      jobTags: '',
                      limit: '',
                      removeColor: false,
                      verbose: true,
                      credential: '',
                      extraVars: '''---
      my_var:  "Jenkins Test"'''
      1. Hi John, 

        The above code works with Pipeline scripts. Many thanks for the updated Wiki and instructions. 

        Quick question, is this plugin compatible with freestyle jobs or just pipeline jobs?


        1. Thanks for confirmation. The plugin also works with Freestyle projects.

          1. Hi John, 

            I am still facing the HashMap error when I try to use Ansible Tower with a FreeStyleJob. Please see code below: 

            //Create Freestyle Jenkins Jobs

            def LinuxEC2Job = freeStyleJob(projectFolderName + "/Jenkins_Scripts/Linux/Ansible_Linux_EC2")

            // Populate Each Freestyle Jenkins Jobs

            description('''Testing Ansible Tower Automation with Linux EC2 Instance''')

            steps {
            towerServer: "Test"


            I have also tried to implement your code structure above but to no avail unfortunately as node and stages are not accepted options for FreeStyleJobs unfortunately. 

            If you have any suggestions, I would be very grateful. 


            1. Hi Morgan, sorry for the delay in response. If I am looking at the correct documentation for that pipeline step ( it appears that plugin is used to create or modify an existing Freestyle Job. Unfortunately, I don't have enough experience with the syntax of that module to tell you how to create a freestyle job which executes an Ansible Tower call from a pipeline. Within Jenkins, if you select "New Item" and then create a "Freestyle project" you should be able to create a job that use the Ansible Tower plugin as.a step as described above in the wiki. If you need to do this through the freeStyleJob pipeline syntax you may need to reach out to the maintainers of the Job DSL Plugin for help.

  8. Hi,

    I'm having an issue whereby ansible tower isn't respecting the limit option sent by Jenkins (in declarative pipline mode). I tried this with and without a limit set in the Ansible Tower template.

    1. Amir, do you have the "prompt on launch" box checked next to Limit in your job template in Tower?

  9. I guess that'll be it - sorry. I must have missed it in the doc. Thanks!

    It's working now, it would be nice if there was a way to pass a "label" to ansible tower so from the jobs interfaces of Ansible Tower - you can have something more verbose about what job is running.

  10. I would like to specify the job type on the build step (since in our environment check is default, but i want to run jobs from Jenkins). 

    I checked out the code and wanted to modify it in order to provide a pull request. 

    Unfortunately, I am not able to build the plugin due to: 

    failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:display-info (display-info) on project ansible-tower: Execution display-info of goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:display-info failed: A required class was missing while executing org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:display-info: org/apache/commons/lang/SystemUtils


    Maven 3.0.4 (also tried with latest version)

    JDK jdk1.8.0_66.jdk


    If I add commons-lang to the local deps, I get an NPE. 


    Any help appreciated. 



    1. Apologies for the delay in a response. How are you attempting to build the plugin manually or via an IDE? And what command are you running? I'm using IntelliJ with a handful of plugins for my primary development but from command line I can see what my versions of maven and java are:

      $ mvn --version
      Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00)
      Maven home: /usr/local/Cellar/maven/3.5.2/libexec
      Java version: 1.8.0_144, vendor: Oracle Corporation
      Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
      Default locale: en_US, platform encoding: UTF-8
      OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac"

      The build command I am using "mvn package" this is generating a file called target/ansible-tower.hpi which can then be uploaded manually into Jenkins.
  11. Sorry for the delay from my side, I was on vacation (smile)

    In the meantime I cross checked the build on a Windows 7, Windows 10, Linux (Ubuntu) and my iMac. 

    Build success on all platforms, so I figure there's something weird with my MacBook Setup (strange, because all other 

    projects build with that machine, and there's a lot of them). 


    My Environment: 

    Idea Ultimate. Tried command line and build from IDE. Standard build command on my side is clean install. 


    I will finish my work, test it with my environment and provide a pull request. 


  12. Hi and thanks for this.

    I'm having an issue with the injection of environment variables.

    My test pipleline is quite simple:

    node {
        stage ('deploy gitlab') {
            wrap([$class: 'AnsiColorBuildWrapper', colorMapName: "xterm"]) {
                    towerServer: 'AWX',
                    jobTemplate: 'deploy_gitlab',
                    importTowerLogs: true,
                    inventory: 'Environnements de Dev',
                    jobTags: 'git-front',
                    limit: '',
                    removeColor: false,
                    verbose: true,
                    credential: '',
                    extraVars: '''---
    gitlab_update_patch: true
        stage ('debug') {
            sh 'env'


    My playbook is passing a variable back as documented above:

    ansible task
    - name: Inject variables in jenkins job/pipeline
            - gitlab_installed: "{{ gitlab_installed }}"
        aggregate: yes
        per_host: no


    The plugin reports the returned variable was correctly parsed but the variable is not in my environment

    Pipeline result
    [Pipeline] node
    Running on NODEx in /jenkins/workspace/TEST_SAM_APPUI/testGitlabDeploy
    [Pipeline] {
    [Pipeline] stage
    [Pipeline] { (deploy gitlab)
    [Pipeline] wrap
    [Pipeline] {
    [Pipeline] ansibleTower
    Beginning Ansible Tower Run on AWX
    Requesting tower to run job template deploy_gitlab
    TASK [gitlab-ce : Inject variables in jenkins job/pipeline] ********************
    ok: [SOMESERVER]
    PLAY RECAP *********************************************************************
    SOMESERVER                 : ok=23   changed=0    unreachable=0    failed=0   
    SOMESERVER2                : ok=2    changed=0    unreachable=0    failed=0   
    Receiving from Jenkins job 'gitlab_installed' with value '10.6.6'
    Tower completed the requested job
    [Pipeline] }
    [Pipeline] // wrap
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] stage
    [Pipeline] { (debug)
    [Pipeline] sh
    [testGitlabDeploy] Running shell script
    + env
    SSH_CLIENT=ip.ip.ip.ip 52642 22
    NODE_LABELS=NODEx java php71 tmc
    SSH_CONNECTION=ip.ip.ip.ip 52642 ip.ip.ip.ip 22
    LESSOPEN=||/usr/bin/ %s
    [Pipeline] }
    [Pipeline] // stage
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    Finished: SUCCESS


    As you can see in the "env" ouput above, there are no environment variables corresponding to the one I passed back (gitlab_installed), either capitalized or not. Anything I missed and must config in my pipeline for this to work ? Thanks.


    Jenkins 2.121.1

    Ansible Tower Plugin 0.8.5

    Environment  injector plugin: 2.1.5

    EnvInject API plugin: 1.5

    1. Hi Oliver, thanks for the report. I wonder if we are hitting a limitation of the Env Inject plugin (EnvInject Plugin#JenkinsPipeline). Can you try to build a standard freestyle project with these two steps and let me know if it works?

      1. Hi John,

        Just tried with a freestyle job and it works as expected in that case: the variable with its value is reported correctly with a subsequent env command after running the job on AWX. Too bad...

        One more question: the plugin configuration currently allows a single user to connect to Tower and is configured globally in jenkins. Is that a design choice ?  Are you planning to allow a per-job configuration ? In our case we have 100++ projects with 1000++ users and we would need to configure the Tower connection for at least every different project ifwe want to use this on production.

        Thanks in advance for your answer.

        1. That was just how I configured the plugin... assuming that the person building the pipeline might not know the Tower authentication information. But I am always opened to change. If we provided a credential override field at the job level would that work better? The admin would still build and test a default connection (url, default username/password) and the job template could override the username/password for the actual connection. This might get a little messy because in the near future Tower will be changing to oauthtokens so there may end up being both credential and oauth override on the job templates.

          If that works for you, please open a feature request at and I will work on that.

  13. is there a way to skip tags using ansible plugin pipeline code?

    1. There is not a current way to do this. Please open a feature request for the plugin at and I will see what I can do to make that happen. 

      1. It's done. The issue no is INFRA-1685

        1. This should be all set. Please pull down version 8.6.0 and let me know if you have any issues.

  14. Thanks for this plugin.

    I have job runs that sometimes fail without showing the error details in the console output in Jenkins (See below). If I see the Tower job-event (/api/v2/jobs/<jobid>/job_events/?page=x), the details are there.

    It looks like the plugin stops processing events once it receives a “failed” event, while Tower sometimes puts the detailed logs in the next event.

    Can you look into this? (I can provide details logs if needed)

    Regards, Niek

    Jenkins Console

    TASK [zzz : aaa] ***************

    included: bla.yml for host1

    TASK [deploy_xxx : Execute yyy ***

    PLAY RECAP *********************************************************************

    host1   : ok=18   changed=9    unreachable=0    failed=1  

    NO MORE HOSTS LEFT *************************************************************

    Tower failed to complete the requested job

  15. there was a build parameter:tag i defined and in Extra Vars , use with tag: "$tag". But the tower  will make some faults when i build the project. How to pass build parameters into the ansible tower's project which  fetch from git.

    In main.yml , it's like echo {{ tag }} > ***.txt

    fatal: []: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'tag' is undefined\n\nThe error appears to have been in '/var/lib/awx/projects/_9__develop/roles/echo/tasks/main.yml'

    1. In order for the job execution to get the extra vars from the Jenkins job you have to make sure that the "Prompt on Launch" option is selected in the job template. If its not checked the Tower API will not accept the passed in extra vars field. If this is what you are hitting you will also see in the Jenkins build log a message like this:
         [WARNING]: Extra variables defined but prompt for variables on launch is not set in tower job

      Please let me know if this does not help and we can work on debugging what might be happening.

  16. Hi,

    I recently updated to 0.9.0 version, but that resulted in a "Username/password invalid", both in 'Test Connection' and Plugin output: "ERROR: Unable to lookup job template Unable to find job template: Username/password invalid"

    Reverting back to the previous version (0.8.5) solved this. Any idea?

    Ansible Tower version 3.2.4, Jenkins version: 2.121.3 (Great plugin btw!)

    1. Sorry for the delay. This should hopefully be fixed with 0.9.1 version of the plugin. Please try it out and let me know if you have any issues.

      1. Hi John.

        Finally had the time to verify and the issue was fixed with the new 0.9.1 version. Thanks

  17. Hi John, 

    Maybe you can shed some lite. I am clueless why i am getting the error while i am trying to connect to Tower via Jenkins. Pretty basic but it gives me this error.

    "Unable to make request for an authtoken: peer not authenticated"

    I try to login into tower with the same user that i am trying to configure the integration between tower and jenkins. no luck.. Any idea what i am missing...

    We are using teh latest version of tower and Ansible Engine.  2.7 & 3.3


  18. Hi,

    I've just started experimenting with Tower (AWX) and I am researching the use of this plugin in our Jenkins CICD pipeline instead of Ansible directly.

    However, I also want to use the Jenkins JUnit Plugin in conjunction with Ansible's JUnit callback.

    How can I consume Ansible's JUnit XML output on the Jenkins node when using the Tower plugin?

    I manually installed the junit_xml python module on the AWX instance with pip, and added "callback_whitelist = junit" to the global ansible.cfg. Now I see junit xml results going to /var/lib/awx/.ansible.log (the default path). However there are several problems:

    • The JUnit XML file only appears after the play completes, so I cant upload it to a known location from the playbook directly
    • How can Jenkins access the file?
    • Even if I can access the files from Jenkins, how do I tie a single xml file from the default directory directory to the Jenkins job from Ansible Tower Plugin (since every XML from every play is there)?
    • I can tell the junit callback to save xml to a specific path, but it needs to be through environment variables, can I even send them with the Tower Plugin?

    Any ideas?