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

Ansible plugin not reading environment variables

    Details

    • Similar Issues:

      Description

      Hello,

       

      I'm trying to read the $BRANCH_NAME env vars in my playbook, just like the Wiki example, but it's empty.

        

      - hosts: "{{ lookup('env','BRANCH_NAME') }}"
        gather_facts: false
      

       

      I'll use the branch name to update some files on target host. Is the any special setup in Ansible or Jenkins for this case? I've tried also with "gather_facts: true" but without success.

        Attachments

          Activity

          rbbrasil Rodrigo Brasil created issue -
          rbbrasil Rodrigo Brasil made changes -
          Field Original Value New Value
          Description Hello,

           

          I'm trying to read the $BRANCH_NAME env vars in my playbook, just like the Wiki example, but it's empty.

           

           
          {code:java}
          - hosts: "{{ lookup('env','BRANCH_NAME') }}"
            gather_facts: false
          {code}
           

           

          I'll use the branch name to update some files on target host. Is the any special setup in Ansible or Jenkins for this case? I've tried also with "gather_facts: true" but without success.
          Hello,

           

          I'm trying to read the $BRANCH_NAME env vars in my playbook, just like the Wiki example, but it's empty.

            
          {code:java}
          - hosts: "{{ lookup('env','BRANCH_NAME') }}"
            gather_facts: false
          {code}
           

          I'll use the branch name to update some files on target host. Is the any special setup in Ansible or Jenkins for this case? I've tried also with "gather_facts: true" but without success.
          rbbrasil Rodrigo Brasil made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Jean-Christophe Sirot [ sirot ] Rodrigo Brasil [ rbbrasil ]
          Resolution Not A Defect [ 7 ]

            People

            • Assignee:
              rbbrasil Rodrigo Brasil
              Reporter:
              rbbrasil Rodrigo Brasil
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: