Kindly refer to Creating valid variable names 
<https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#creating-valid-variable-names>
 
- 
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#creating-valid-variable-names.
E.g. I had to drop usage of dash in variable names in order to get my 
playbook to parse without errors.

On Friday, July 12, 2019 at 4:20:42 PM UTC+2, JiElPe-Fr38 wrote:
>
> Dear all,
>
> I have defined a var which contains some special characters (actually, a 
> password in a vault).
> Let's assume the vault contains :
> myPasswd: foo@bar
>
> There is no problem when creating the encrypted file.
>
> When I use it somewhere in a playbook, for example :
> password: "{{ myPasswd }}"
>
> I get the error message in the subject : 
>
> jinja2 templating error : template error while templating string: 
> unexpected char '@'  at 5. String: {{foo@bar}}"
>
> So, though the var is encrypted in the vault (and can be correctl 
> decrypted when viewing or editing), and is actually decrypted when used, it 
> cannot be "jinja2 evaluated".
> Note that when removing such a character (! has the same problem, and I 
> often use it in passwords), there is no more problem and the var is 
> correctly set and used.
> It is clear not a vault problem.
>
> Could it be a bug around jinja2 templating, or is there something to use 
> in order to escape such characters ?
>
> Thanks for your help !
>
> Best Regards
> J-L
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c7ff830a-c439-4521-906c-a885d89c3521%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to