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
this structure:
mysecret: !vault |
$ANSIBLE_VAULT;1.1;AES256
66386439653236336462626566653063336164663966303231363934653561363964363833313662
6431626536303530376336343832656537303632313433360a626438346336353331386135323734
62656361653630373231613662633962316233633936396165386439616533353965373339616234
3430613539666330390a313736323265656432366236633330313963326365653937323833366536
34623731376664623134383463316265643436343438623266623965636363326136
yields this error:
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
so according to that documentation:
you just have to be sure to add the !vault tag so both Ansible and YAML are aware of the need to decrypt.
i've installed ansible via yum:
rpm -qa|grep ansible
ansible-2.3.0.0-3.el7.noarch
was there something else that needed to be updated for the yaml parsing to succeed with the encrypted variable?