# ansible-pull and group\_vars

**URL:** <https://forum.ansible.com/t/ansible-pull-and-group-vars/14989>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [April 10, 2014, 1:38pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989 "2014-04-10T13:38:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred\_Badel](https://avatars.discourse-cdn.com/v4/letter/f/f07891/32.png) [@Fred\_Badel](https://forum.ansible.com/u/Fred_Badel)\
**Post date:** [April 10, 2014, 1:38pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/1 "2014-04-10T13:38:36Z")

</div>

Hello,

I am trying to set ansible-pull to provision ec2 instances … with not much success so far …

I tried using the ec2.py dynamic inventory:

ansible-pull -C feature/ci -d /home/ec2-user/ansible -i ansible/ec2.py tag\_Name\_qatest23 -U ssh://git@repo/infra/ansible-play.git local.yml

and I get the following error:  
ansible-pull “ERROR: provided hosts list is empty”

When trying a static inventory file with :

[coyote]  
127.0.0.1 ansible\_connection=local

[eu-west-1:children]  
coyote

ansible-pull -C feature/ci -d /home/ec2-user/ansible -i /home/ec2-user/ansible/inventories/QA.yml -U ssh://git@stash.aws.onlotaris.com/infra/ansible-play.git local.yml

the playbook runs, but group\_vars does not seem to be evaluated…

Is this a normal behavior?

Thanks.

Fred

---

<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:** [April 11, 2014, 1:34am UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/2 "2014-04-11T01:34:03Z")

</div>

Correct me if I am wrong, but it seems like you are trying manage other ec2 hosts with ansible-pull? ansible-pull is designed to only run plays against the current host and in fact limits the inventory to localhost/127.0.0.1. If your intent is to execute playbooks when a git repo changes or from a git repo, you will need to combine git and ansible-playbook into a custom script. #!/usr/bin/psuedo-code cd $checkout git pull --rebase ansible-playbook -i inventory site.yml You could also create a simple wrapper play … - hosts: localhost gather\_facts: False tasks: - git: register: git\_check - shell: ansible-playbook when: git\_check.changed

---

<div class="post-metadata">

**Author:** ![Fred\_Badel](https://avatars.discourse-cdn.com/v4/letter/f/f07891/32.png) [@Fred\_Badel](https://forum.ansible.com/u/Fred_Badel)\
**Post date:** [April 11, 2014, 8:41am UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/3 "2014-04-11T08:41:14Z")

</div>

Hi James,

I am running the plays against the host running ansible-pull. But I was expecting ansible to be able to evaluate the group membership of localhost and load the proper group\_vars files.

Thanks,

Fred

---

<div class="post-metadata">

**Author:** ![Jean-Sebastien\_Moure](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jean-Sebastien\_Moure](https://forum.ansible.com/u/Jean-Sebastien_Moure)\
**Post date:** [April 14, 2014, 10:02am UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/4 "2014-04-14T10:02:25Z")

</div>

This used to work fine but not anymore since a week or so.

---

<div class="post-metadata">

**Author:** ![Fred\_Badel](https://avatars.discourse-cdn.com/v4/letter/f/f07891/32.png) [@Fred\_Badel](https://forum.ansible.com/u/Fred_Badel)\
**Post date:** [April 14, 2014, 2:40pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/5 "2014-04-14T14:40:28Z")

</div>

Hi Jean-Sebastien,

Really? can you confirm that you’ve been using ansible-pull having the group\_vars successfully evaluated?

How come is this not working anymore? is it an issue that no one raised so far ? or is it a documented new behavior?

Cheers,

Fred

---

<div class="post-metadata">

**Author:** ![Jean-Sebastien\_Moure](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jean-Sebastien\_Moure](https://forum.ansible.com/u/Jean-Sebastien_Moure)\
**Post date:** [April 14, 2014, 3:26pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/6 "2014-04-14T15:26:44Z")

</div>

Don’t know if it is a documented behavior.

I was generating /etc/ansible/hosts with localhost belonging to a specific group.  
Then ansible-pull from a repository with the corresponding group\_vars/group defined.  
It used to work fine and broke last week.  
I’m using the ansible package from ubuntu trusty.

I have switched to git clone + ansible-playbook in the meantime.

---

<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:** [April 15, 2014, 9:07pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/7 "2014-04-15T21:07:12Z")

</div>

FYI – There’s currently a ticket open on this one.

---

<div class="post-metadata">

**Author:** ![Rob\_Johnston](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@Rob\_Johnston](https://forum.ansible.com/u/Rob_Johnston)\
**Post date:** [May 27, 2014, 10:59pm UTC](https://forum.ansible.com/t/ansible-pull-and-group-vars/14989/8 "2014-05-27T22:59:31Z")

</div>

Hi Michael

Could you please provide a link to the ticket for us future people?

This is the closest I found at around the right age, with my limited understanding of the problem: [https://github.com/ansible/ansible/issues/6563](https://github.com/ansible/ansible/issues/6563)
