Re: [awx-project] [help] Ansible AWX and evn variables

138 views
Skip to first unread message

Christopher Meyers

unread,
Sep 25, 2018, 10:08:38 AM9/25/18
to gso...@gmail.com, AWX Project
The variables field is for Ansible extra_vars that will be injected in a playbook run, not an inventory sync. It looks like you want ENV vars injected into your custom inventory script during an inventory sync. For that, you can use a custom credential type. https://docs.ansible.com/ansible-tower/latest/html/userguide/credential_types.html

On Tue, Sep 25, 2018 at 9:27 AM <gso...@gmail.com> wrote:
Hi,
I'm new in the AWX (or tower),
i like to add promo.py inventory script
i have added the scrip to AWX and added variables to inventory
as for source, i have choose the custom script from
https://raw.githubusercontent.com/xezpeleta/Ansible-Proxmox-inventory/master/proxmox.py
running it from cli with --list and exported varaibles is working fine.
I cleary notice that im doing something wrong.
So i have save the user and url to file, like:
    file7 = open('test_list7_file.txt','w+')
    file7.write(os.environ.get('PROXMOX_USERNAME'))
    file7.write(os.environ.get('PROXMOX_URL'))
    file7.close()
and in file
apiuser@pve https://10.0.0.1:8006/
So it's cleary not working.

What is the correct way to make that workign?

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/630e04aa-3c69-45b0-b3f2-88005490c56f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

CHRIS MEYERS

SENIOR SOFTWARE ENGINEER, TOWERREWARD ZONE AMBASSADOR

Red Hat 

cme...@redhat.com   


Reply all
Reply to author
Forward
0 new messages