-
Bug
-
Resolution: Fixed
-
Minor
-
Jenkins 2.7.3
Pipeline plugin 2.3
Ansible plugin 0.5
The "ansiblePlaybook" step doesn't seem to respect variables set with "env.NAME = VALUE" or with "withEnv([NAME: VALUE]) {...}". In my particular case, ANSIBLE_CONFIG needs to be set so that a custom Ansible configuration file can be used.
I've created a simple pipeline job to illustrate the issue (linked below). Despite ANSIBLE_CONFIG being set, it is not present in the ansible-playbook process's environment (confirmed by looking at /proc/ANSIBLE_PID/environ).
Pipeline job: https://gist.github.com/agunnerson-ibm/dd065a950269d68fbb84e64425bad08e#file-pipeline-groovy
Job log: https://gist.github.com/agunnerson-ibm/dd065a950269d68fbb84e64425bad08e#file-job-log (Note how it loads /etc/ansible/ansible.cfg instead of the custom config)