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.
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]
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://git@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