# single encrypted vault variable not working

**URL:** <https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488>\
**Category:** Ansible Project\
**Created:** [May 15, 2017, 10:50pm UTC](https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488 "2017-05-15T22:50:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Jolet](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@John\_Jolet](https://forum.ansible.com/u/John_Jolet)\
**Post date:** [May 15, 2017, 10:50pm UTC](https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488/1 "2017-05-15T22:50:19Z")

</div>

I’m running ansible 2.3.0.0,and attempting to use an inline encrypted variable per this documentation:  
[http://docs.ansible.com/ansible/playbooks\_vault.html#running-a-playbook-with-vault](http://docs.ansible.com/ansible/playbooks_vault.html#running-a-playbook-with-vault)

this structure:

```auto
mysecret: !vault |
          $ANSIBLE_VAULT;1.1;AES256
          66386439653236336462626566653063336164663966303231363934653561363964363833313662
          6431626536303530376336343832656537303632313433360a626438346336353331386135323734
          62656361653630373231613662633962316233633936396165386439616533353965373339616234
          3430613539666330390a313736323265656432366236633330313963326365653937323833366536
          34623731376664623134383463316265643436343438623266623965636363326136

```

```auto

```

```auto
yields this error:

```

```auto
ERROR! Syntax Error while loading YAML.

The error appears to have been in '/home/Q2DC/jjolet/ansible-operations/configure/group_vars/nomad-servers-stg.yml': line 13, column 14, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

q2docker_file: "q2docker1.2.1"
vault_token: !vault |
             ^ here

```

```auto

```

```auto
so according to that documentation: 

```

```auto
you just have to be sure to add the !vault tag so both Ansible and YAML are aware of the need to decrypt.

```

```auto
i've installed ansible via yum:

```

```auto
rpm -qa|grep ansible
ansible-2.3.0.0-3.el7.noarch

```

```auto
was there something else that needed to be updated for the yaml parsing to succeed with the encrypted variable?

```

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [May 18, 2017, 5:31pm UTC](https://forum.ansible.com/t/single-encrypted-vault-variable-not-working/24488/2 "2017-05-18T17:31:23Z")

</div>

You get this error message if you don't provide a vault password.
