# group\_vars appear to be skipped for implicit localhost when using inventory plugin

**URL:** <https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800>\
**Category:** Ansible Project\
**Created:** [March 18, 2014, 4:44pm UTC](https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800 "2014-03-18T16:44:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [March 18, 2014, 4:44pm UTC](https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800/1 "2014-03-18T16:44:55Z")

</div>

Hello list,

I think I’m seeing “group\_vars/all” get skipped for implicit localhost when using the ec2.py inventory script. I’ve tried writing a few simplified example plays but they all worked, so I’m either missing something obvious or the issue was in a part I tried to stub out. So here is what I hope will be a succinct verbal description instead…

I’m working on an ec2 deployment that has a few playbooks that are run by separate calls to ansible-playbook, via a pretty simple bash wrapper script. The first call to ansible-playbook creates the ec2 instances pretty normally, getting vars like account credentials and instance type from group\_vars/all. Then we return to our bash wrapper which does a bunch of work while the instances start, and then makes a separate call to ansible-playbook (this time using -i ec2.py) that configures the instances. It is in this second call to ansible-playbook that I’m getting errors that my vars to access ec2 are not defined.

I think the culprit is in using a dynamic inventory because I tried specifying ec2.py for the first (instance creation) ansible-playbook call too, and it also started failing saying vars were undefined.

This is roughly what the bash script is doing at the time:

> # Request the instances, don’t wait for them
> 
> ansible-playbook -f 25 create\_instances.yml --private-key=key -e “stuff like fqdn of site, server-group name, etc, wait=no”
> 
> #prep composer and npm type dependencies on build server while waiting for instances  
> ec2.py --refresh-cache &\>/dev/null
> 
> # Provision instances in their respective roles
> 
> ansible-playbook -f 25 -i ec2.py provision\_instances.yml --private-key=key -e “stuff like fqdn of site, server-group name, etc, wait=yes”

Any insights much appreciated.

Thank you,  
Mark

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 18, 2014, 4:46pm UTC](https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800/2 "2014-03-18T16:46:37Z")

</div>

The implicit localhost feature is new, and it’s not technically part of any group, so I’m not too surprised it doesn’t read group variables for the host.

If you’d like to file a github ticket we can look into making sure it gets variables from the “all” group.

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [March 18, 2014, 4:48pm UTC](https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800/3 "2014-03-18T16:48:56Z")

</div>

Can we see the second playbook?

---

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [March 18, 2014, 8:07pm UTC](https://forum.ansible.com/t/group-vars-appear-to-be-skipped-for-implicit-localhost-when-using-inventory-plugin/14800/4 "2014-03-18T20:07:36Z")

</div>

I’d sent the playbook off-list, but I’ve now filed a github ticket with a more succinct example case.

For now as a workaround I’m going to try explicitly importing group\_vars/all in cases where this happens, though I’m a little curious what will happen (merge/overwrite with identical, etc.) to the vars once the issue I’m seeing is no longer happening.

Thank you,  
Mark
