git pull not supported by ansible git module?

425 views
Skip to first unread message

namrat...@cube26.com

unread,
Jun 4, 2015, 11:32:59 AM6/4/15
to ansible...@googlegroups.com
I have a private git repo and I want it cloned onto my remote servers in the first execution of my playbook. Thereafter I want my repo to be pulled, not cloned over and over again for any change i make in the repository. What is the way to do that?
Right now my repo is cloned on every run of my playbook. Not very efficient.

Brian Coca

unread,
Jun 5, 2015, 10:04:02 AM6/5/15
to ansible...@googlegroups.com
i think you are looking for the clone=no option.

from ansible-doc git:

- clone
If `no', do not clone the repository if it does not exist
locally (Choices: yes, no) [Default: yes]



--
Brian Coca

Toshio Kuratomi

unread,
Jun 5, 2015, 10:20:36 AM6/5/15
to ansible...@googlegroups.com


On Jun 4, 2015 8:32 AM, <namrat...@cube26.com> wrote:
>
> I have a private git repo and I want it cloned onto my remote servers in the first execution of my playbook. Thereafter I want my repo to be pulled, not cloned over and over again for any change i make in the repository. What is the way to do that?
> Right now my repo is cloned on every run of my playbook. Not very efficient.
>

Are you using the git module or an ad hoc shell command?  The git module should do what you want with something like this:

- git:
      repo:  "ssh://g...@github.com/mylogin/hello.git"
      dest: /home/mylogin/hello

If it's cloning every time, some more information about how you are able to diagnose that it is cloning would be helpful.

-Toshio

Reply all
Reply to author
Forward
0 new messages