# can't add vault-encrypted vars to template

**URL:** <https://forum.ansible.com/t/cant-add-vault-encrypted-vars-to-template/29941>\
**Category:** AWX Project\
**Created:** [March 21, 2019, 6:10pm UTC](https://forum.ansible.com/t/cant-add-vault-encrypted-vars-to-template/29941 "2019-03-21T18:10:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmakovey](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@dmakovey](https://forum.ansible.com/u/dmakovey)\
**Post date:** [March 21, 2019, 6:10pm UTC](https://forum.ansible.com/t/cant-add-vault-encrypted-vars-to-template/29941/1 "2019-03-21T18:10:24Z")

</div>

I've used

ansible-vault encrypt\_string ..

command to encrypt several vars for playbook run, however when I paste  
encrypted var stanza into the "extra variables" field for Job Template -  
I get an error. Is that intentional? Am I supposed to commit my secrets  
(even if it's in encrypted form) to version control system (in my case  
Git) and use "include\_vars or similar techniques?

---

<div class="post-metadata">

**Author:** ![AlanCoding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alancoding/32/301_2.png) [@AlanCoding](https://forum.ansible.com/u/AlanCoding)\
**Post date:** [March 21, 2019, 7:15pm UTC](https://forum.ansible.com/t/cant-add-vault-encrypted-vars-to-template/29941/2 "2019-03-21T19:15:33Z")

</div>

There is an open issue for this, and an attempted fix is in the pull request queue.  
Since the attempt was began, some flaws in it were discovered.

I know it doesn’t sound like a difficult problem, but it’s actually tricky to preserve the vault representations along with the other things we do with extra\_vars pre-run for security related issues and stuff like that.

It’s a cool use-case, and I would like to get it working. It’s on the agenda, but it needs some time.
