# Problems with Vault in AWX Inventory

**URL:** <https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [August 24, 2022, 11:07am UTC](https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031 "2022-08-24T11:07:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nationofhoopleet\_cry](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@nationofhoopleet\_cry](https://forum.ansible.com/u/nationofhoopleet_cry)\
**Post date:** [August 24, 2022, 11:07am UTC](https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031/1 "2022-08-24T11:07:08Z")

</div>

Hello Together!  
since few days i try to figure out how to use ansible vault encrypted strings in the AWX Inventory.

With an unencrypted password, everything is working fine.

Passwords secure with vault dont work for some reason.  
it wont be decrypted.

This is what i am using:

{  
“ansible\_connection”: “winrm”,  
“ansible\_port”: “5985”,  
“ansible\_password”: “!vault | $ANSIBLE\_VAULT;1.1;AES256\n\<my\_long\_password\_string”,  
“ansible\_user”: “[admin@mydomain.com](mailto:admin@mydomain.com)”,  
“ansible\_winrm\_server\_cert\_validation”: “ignore”  
}

i Read something about to change  
mysql\_password: !vault | ansible vault stuff  
to  
mysql\_password: \_\_ansible\_vault: | ansible vault stuff

But i cant get it work 😕

Maybe somene got the answere for me.  
Thanks !!!

Greetings

Chris

---

<div class="post-metadata">

**Author:** ![m.nelson](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@m.nelson](https://forum.ansible.com/u/m.nelson)\
**Post date:** [August 24, 2022, 12:50pm UTC](https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031/2 "2022-08-24T12:50:40Z")

</div>

Hi Chris,  
Have you tried creating a machine credential in tower and apply it to your job template?  
Result: the password would be encrypted by tower and you would not need the variables: ansible\_password and ansible\_user.

You can also create a vault credential in tower and apply it as a second credential to the job template.  
Result: vault encrypted files will be automatically decrypted.

Good luck,

---

<div class="post-metadata">

**Author:** ![nationofhoopleet\_cry](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@nationofhoopleet\_cry](https://forum.ansible.com/u/nationofhoopleet_cry)\
**Post date:** [August 24, 2022, 1:11pm UTC](https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031/3 "2022-08-24T13:11:28Z")

</div>

Thank you for your reply.  
I really need the Encrypted string in the Inventory.

I am using the Vault Secret and SSH Linux Machine Secret. So i cant add a second machine credential.  
I know it is working but i dont know the right syntax.

Greetings  
Chris

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [August 24, 2022, 6:26pm UTC](https://forum.ansible.com/t/problems-with-vault-in-awx-inventory/37031/4 "2022-08-24T18:26:17Z")

</div>

Hi Chris,  
In your last message you’re using a Linux Machine Secret but in your first message I see a WinRM secret, could you try to explain a little bit more about what you’re doing and why you need both credentials?  
Thanks,  
AWX Team
