# vault-id and multiple password files in ansible.cfg

**URL:** <https://forum.ansible.com/t/vault-id-and-multiple-password-files-in-ansible-cfg/26613>\
**Category:** Ansible Project\
**Created:** [January 31, 2018, 11:27am UTC](https://forum.ansible.com/t/vault-id-and-multiple-password-files-in-ansible-cfg/26613 "2018-01-31T11:27:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kompastver](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@kompastver](https://forum.ansible.com/u/kompastver)\
**Post date:** [January 31, 2018, 11:27am UTC](https://forum.ansible.com/t/vault-id-and-multiple-password-files-in-ansible-cfg/26613/1 "2018-01-31T11:27:05Z")

</div>

Hi,  
We’re using vault files encrypted with multiple vault-id in our projects.  
Everything works fine when we do something like:

`ansible vault --vault-id generic@~/.ansible/generic-password --vault-id prod@~/.ansible/prod-password ...`

But it’s not convenient way to pass password files for each vault id as cli arguments.  
Previously, before vault-id, we used single password for everything and we just added “vault\_password\_file=~/.ansible/password” into ansible.cfg.  
Is there any way to add multiple password file in ansible.cfg for each vault id?  
The most straight way as for me, is to add something like this

`[defaults] vault_password_file=generic@~/.ansible/generic-password vault_password_file=prod@~/.ansible/prod-password`

And of course it doesn’t work.  
But how can I do it right?

Thanks.

---

<div class="post-metadata">

**Author:** ![hans\_petterson](https://avatars.discourse-cdn.com/v4/letter/h/8dc957/32.png) [@hans\_petterson](https://forum.ansible.com/u/hans_petterson)\
**Post date:** [April 27, 2018, 11:45am UTC](https://forum.ansible.com/t/vault-id-and-multiple-password-files-in-ansible-cfg/26613/2 "2018-04-27T11:45:22Z")

</div>

Hi,

just stumpled upon the same problem. Using the cli --vault-id is not really practicable in our case. No one wants to write this long string. Vault-id seems like a nice thing… but not really thought through. Or am I missing something?

Yours
