# ansible-pull

**URL:** <https://forum.ansible.com/t/ansible-pull/12243>\
**Category:** Ansible Project\
**Created:** [January 24, 2013, 9:28am UTC](https://forum.ansible.com/t/ansible-pull/12243 "2013-01-24T09:28:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [January 24, 2013, 9:28am UTC](https://forum.ansible.com/t/ansible-pull/12243/1 "2013-01-24T09:28:08Z")

</div>

I am confused by ansible pull:

The example seems indicate that we need to create "workdir" and a "repo\_url" variable. Is this correct, or I mis-read that?

When running ansible-pull, I always have to specify both -U and -d. Is this by design? I assumed that this was the point of setting workdir and repo\_url...

Thanks.

---

<div class="post-metadata">

**Author:** ![Rodney\_Quillo](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rodney\_Quillo](https://forum.ansible.com/u/Rodney_Quillo)\
**Post date:** [January 24, 2013, 9:47am UTC](https://forum.ansible.com/t/ansible-pull/12243/2 "2013-01-24T09:47:13Z")

</div>

I believe the steps for ansible-pull are:

1. The repo\_url is your git repo containing your playbooks.  
2. That repo is cloned to you workdir.  
3. ansible-pull starts executing the local.yml found on your workdir.

Here's my example running ansible-pull inside EC2:  
[http://www.capsunlock.net/2012/05/using-ansible-pull-and-user-data-to-setup-ec2-or-openstack-servers.html](http://www.capsunlock.net/2012/05/using-ansible-pull-and-user-data-to-setup-ec2-or-openstack-servers.html)

Rodney

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [January 24, 2013, 2:59pm UTC](https://forum.ansible.com/t/ansible-pull/12243/3 "2013-01-24T14:59:38Z")

</div>

Yes this works for me, as long as I specify the location of the git repo and the target directory on the command line. What I was wondering though, is if there is indeed a special purpose for the variable "working\_dir" and "repo\_url" as given in ansible/examples/plyabooks/ansible\_pull.yml?

Especially the repo\_url, as it is not re-used anywhere else in the example.

---

<div class="post-metadata">

**Author:** ![Rodney\_Quillo](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@Rodney\_Quillo](https://forum.ansible.com/u/Rodney_Quillo)\
**Post date:** [January 25, 2013, 12:56am UTC](https://forum.ansible.com/t/ansible-pull/12243/4 "2013-01-25T00:56:28Z")

</div>

On the example ansible\_pull.yml, I think repo\_url is used in template.  
See /playbooks/templates/etc\_cron.d\_ansible-pull.j2

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [January 25, 2013, 8:47am UTC](https://forum.ansible.com/t/ansible-pull/12243/5 "2013-01-25T08:47:07Z")

</div>

I see it now. Thanks.
