# Vault Ids and Multiple Vault Passwords

**URL:** <https://forum.ansible.com/t/vault-ids-and-multiple-vault-passwords/28166>\
**Category:** Ansible Project\
**Created:** [July 26, 2018, 4:53pm UTC](https://forum.ansible.com/t/vault-ids-and-multiple-vault-passwords/28166 "2018-07-26T16:53:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![supermario18b](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@supermario18b](https://forum.ansible.com/u/supermario18b)\
**Post date:** [July 26, 2018, 4:53pm UTC](https://forum.ansible.com/t/vault-ids-and-multiple-vault-passwords/28166/1 "2018-07-26T16:53:52Z")

</div>

Hi everyone,

I’m tryng to understand how multiple vault passwords work.

I found this example about providing vault-id passwords:

`  
ansible-playbook --vault-id dev@dev-password --vault-id prod@prompt site.yml

`

```auto

In the example above ansible first tries the dev password and if it doesn't work it prompts for a password.  

I'd like to know if something similar to this is possible:

ansible-playbook --vault-id dev@dev-password --vault-id dev2@dev-password site.yml

(2 different passwords in the same dev-password file)

if yes, I'm not able to have/set 2 passwords with two ids in the same vaultfile.

At the moment I know:

ansible-vault encrypt_string --vault-id dev@dev-password --stdin-name 'dev_string'

but naturally if a type:

ansible-vault encrypt_string --vault-id dev2@dev-password --stdin-name 'dev_string2'

only the password in dev-password will be used and it'll be the same of dev.

Can you tell me how to do it?

Thanks

 

```

---

<div class="post-metadata">

**Author:** ![supermario18b](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@supermario18b](https://forum.ansible.com/u/supermario18b)\
**Post date:** [July 29, 2018, 9:59am UTC](https://forum.ansible.com/t/vault-ids-and-multiple-vault-passwords/28166/2 "2018-07-29T09:59:23Z")

</div>

At the moment I understand that I can pass multiple password files with --vault-id.

What I don’t understand is the scope of labels. As I see I can’t user different labels for the same password file. So why use them?

I’m aware that I’m missing something 🙂 Could you point me to the right direction?
