Custom Credential injector yml file creation

177 views
Skip to first unread message

Stephen Eaton

unread,
Apr 26, 2018, 2:25:05 AM4/26/18
to AWX Project
Hi one and all,

Can custom credential injectors create YAML files?   

I'm trying to get an inventory script working (https://github.com/mattkeeler/ansible-nutanix-inventory) in AWX and it requires a YAML config file.  I see that credential injectors can create a file, but the docs are very sparse around this. 

Thanks,

Stephen...

Ryan Petrello

unread,
Apr 26, 2018, 9:02:28 AM4/26/18
to AWX Project
Hey Stephen,

You can write whatever file content you like, though there aren't any helpers for serializing YAML - you'll have to actually write the YAML content yourself, e.g.,

{
    "file": {
        "template": "clusters:\n    {{ cluster }}:\n        address: {{ address }}\n        port: {{ port }}\n        username: {{ username }}\n        password: {{ password }}"
    },
    "env": {
        "NUTANIX_YML_PATH": "{{ tower.filename }}"
    }
}

etc...
Reply all
Reply to author
Forward
0 new messages