Thanks for the response. I am familiar with adding in extra-vars to reference a variable in a playbook, but with these environment variables…how will use it within a play to reference a variable? Is it more or less the same?
In your original email, you mentioned the Ansible module tower_job_template.
It was a specific design objective that the “Ansible Tower” credential type work with these modules. However, this has a few qualifiers.
If you run a playbook with a local connection, or delegate_to localhost (I think), then the environment variables present when you run the ansible-playbook command will be present when the task executes. This makes perfect sense in conjunction with using an “Ansible Tower” credential (inside of AWX), because the credential injects secrets needed to interact with the API. There’s no need to run these tasks on a remote host. However, if you do run on a remote host, those environment variables will no longer be present, and you need to get around that by using the lookup plugin, as mentioned.
Similar statements apply to most of the other “cloud” type credentials.
Thanks Alan! This provides more clarity about how it works. So what you are saying is that the enviroment variables present themselves on the local host in this case on the container.
I am presuming then the look up plugin will have to be captured on the local host using perhaps includes and then it can be used elsewhere in the play