# Vault and "dictionaries" - bug or feature request?

**URL:** <https://forum.ansible.com/t/vault-and-dictionaries-bug-or-feature-request/25725>\
**Category:** Ansible Project\
**Created:** [October 12, 2017, 2:24am UTC](https://forum.ansible.com/t/vault-and-dictionaries-bug-or-feature-request/25725 "2017-10-12T02:24:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan\_linder](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dan_linder/32/3833_2.png) [@dan\_linder](https://forum.ansible.com/u/dan_linder)\
**Post date:** [October 12, 2017, 2:24am UTC](https://forum.ansible.com/t/vault-and-dictionaries-bug-or-feature-request/25725/1 "2017-10-12T02:24:57Z")

</div>

I’ve have a dictionary variable setup that has accounts and passwords:

`  
password\_list:

- { name: “user1”,  
password: “user1pwd”  
}
- { name: “user2”,  
password: “user2pwd”  
}
- { name: “user3”,  
password: “user3pwd”  
}

`

This variable it works as expected. When I update one of the passwords to a vaulted version like this:

`  
password\_list:

- { name: “user1”,  
password: “user1pwd”  
}
- { name: “user2”,  
password: !vault |  
$ANSIBLE\_VAULT;1.1;AES256  
66366265333266666432626431646631356664663262326535346265353939383239626634636331  
6462666364303539336132346430346432333564346663300a623333613666333330626330643735  
64613664383733333839313434303433663164363030383663336663656432613965663862656237  
3631366664646332610a636230616334306232336263313139623264663338613538643163356239  
3732  
}
- { name: “user3”,  
password: “user3pwd”  
}

`

…the ansible-playbook complains about it with this message:

`

The offending line appears to be:

- { name: “user2”,  
password: !vault |  
^ here

exception type: \<class ‘yaml.scanner.ScannerError’\>  
exception: while scanning for the next token  
found character that cannot start any token  
in “”, line 30, column 28

`

I’ve tried variations such as removing the “|” and putting everything from “!vault” through “3732” on the same line (removing spaces), using a “\<” instead of the “|”, etc.

Am I doing it wrong? Is this a bug in the vault string handling that I should report? Or is this a “not yet implemented” variation on vault data that I should put in for a feature request?

---

<div class="post-metadata">

**Author:** ![dan\_linder](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dan_linder/32/3833_2.png) [@dan\_linder](https://forum.ansible.com/u/dan_linder)\
**Post date:** [October 16, 2017, 7:23pm UTC](https://forum.ansible.com/t/vault-and-dictionaries-bug-or-feature-request/25725/2 "2017-10-16T19:23:25Z")

</div>

I’ve added an issue to the Ansible github project for this:

[https://github.com/ansible/ansible/issues/31705](https://github.com/ansible/ansible/issues/31705)

For what it’s worth, if I convert the variable to a dictionary (instead of a list) and pass that through the list Jinja2 filter it works as a list:

`
