Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56250

Ansible Tower Plugin not injecting Environment Variables for later use

XMLWordPrintable

      Issue:
      When creating a ENV variable within the Ansible Tower plugin API calls on a pipeline, that ENV variable is not usable inside of subsequent steps for Jenkins.

      Steps to reproduce:
      1. Create a Pipeline job with an Ansible Tower step
      2. Inside of that step call an ansible script which uses the suggested line:

       - name: Set a Jenkins variable
            debug:
              msg: "JENKINS_EXPORT VAR_NAME=value"
      

      3. Try to echo that `VAR_NAME` using an `echo ${env.VAR_NAME} in a new stage
      4. Observe the variable comes back as "null"

      I even tried to expand the scope of the variable name using a `withEnv(['VAR_NAME=""']) {` at the beginning but that still does not work

      Expected Result:
      I would expect to see a ENV variable later in the pipeline but maybe the scope of that variable is only for within the ansible script?

            johnwestcottiv John Westcott
            ataylor Alex Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: