# Issues with specifying group vars with a dynamic EC2 inventory

**URL:** <https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 3, 2020, 9:09pm UTC](https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123 "2020-02-03T21:09:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Madill](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Justin\_Madill](https://forum.ansible.com/u/Justin_Madill)\
**Post date:** [February 3, 2020, 9:09pm UTC](https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123/1 "2020-02-03T21:09:06Z")

</div>

I’m currently building out a PoC with Ansible Tower to manage our primarily windows environment.  
I’ve had everything working from the command line before starting with Tower, that that was using a static inventory.

The problem I’m having right now is finding a method for specifying the connection variables for windows servers (without also having them applied to non windows servers).  
The variables I need to setup are:

ansible\_user: ansible@MYDOMAIN.AD  
ansible\_password: \>-  
!vault | $ANSIBLE\_VAULT;1.1;AES256  
35663130633434366336353562303031613263663936653164383937353362643531343561373365  
6165663533336561353137333166613062663631356630340a393764666466346165316337626336  
39353764316532693166323931363264363137343466343563613663366434313261623265643066  
3130313935343866350a346166363061616338623662343763613630343362653061376465303835  
6535  
ansible\_port: 5985  
ansible\_connection: winrm  
ansible\_winrm\_server\_cert\_validation: ignore  
ansible\_winrm\_transport: kerberos

I was able to manually add them to the ec2 tag based group that i’ve setup for the windows machines, and while they were picked up, it appears to not know that it needs to decrypt the password, and putting that vault value in with the standard syntax (no \>- at the start) just throws a parsing error on save.  
Though even if I do get this method working if we ever need to rebuild the inventory from scratch those values would be lost.

I have read through dozens of issue reports, blog posts, and google group posts on this topic and couldn’t find any solutions or even other ideas to try.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 3, 2020, 9:55pm UTC](https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123/2 "2020-02-03T21:55:33Z")

</div>

This sounds like it was potentially fixed with [https://github.com/ansible/ansible/pull/65023](https://github.com/ansible/ansible/pull/65023) which has been backported to Ansible 2.9. What Ansible version are you running?

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Justin\_Madill](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Justin\_Madill](https://forum.ansible.com/u/Justin_Madill)\
**Post date:** [February 3, 2020, 10:05pm UTC](https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123/3 "2020-02-03T22:05:31Z")

</div>

I am currently running Ansible 2.9.1 and Tower 3.6.2

---

<div class="post-metadata">

**Author:** ![Justin\_Madill](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Justin\_Madill](https://forum.ansible.com/u/Justin_Madill)\
**Post date:** [February 3, 2020, 10:25pm UTC](https://forum.ansible.com/t/issues-with-specifying-group-vars-with-a-dynamic-ec2-inventory/32123/4 "2020-02-03T22:25:31Z")

</div>

Well I’ve found a solution that also fixes the volatility issue by adding a group\_vars folder beside my playbooks in the project then I can use the standard vault variable syntax as well.
