ANSIBLE.GIT(3)

NAME
git - Deploy software (or files) from git checkouts

DESCRIPTION

Manage git checkouts of repositories to deploy files or software.

OPTIONS

bare
    if yes, repository will be created as a bare repo, otherwise it will be a standard repo with a workspace. Choices: yes,no. (default: no)(Added in Ansible version 1.4.)

depth
    Create a shallow clone with a history truncated to the specified number or revisions. The minimum possible value is 1, otherwise ignored.(Added in Ansible version 1.2.)

dest
    Absolute path of where the repository should be checked out to.(required)

executable
    Path to git executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.(Added in Ansible version 1.4.)

force
    If yes, any modified files in the working repository will be discarded. Prior to 0.7, this was always 'yes' and could not be disabled. Choices: yes,no. (default: yes)(Added in Ansible version 0.7.)

reference
    Reference repository (see "git clone --reference ...")(Added in Ansible version 1.4.)

remote
    Name of the remote. (default: origin)

repo
    git, SSH, or HTTP protocol address of the git repository.(required)

update
    If yes, repository will be updated using the supplied remote. Otherwise the repo will be left untouched. Prior to 1.2, this was always 'yes' and could not be disabled. Choices: yes,no. (default: yes)(Added in Ansible version 1.2.)

version
    What version of the repository to check out. This can be the full 40-character SHA-1 hash, the literal string HEAD, a branch name, or a tag name. (default: HEAD).

NOTES

If the task seems to be hanging, first verify remote host is in known_hosts. SSH will prompt user to authorize the first contact with a remote host. To avoid this prompt, one solution is to add the remote host public key in /etc/ssh/ssh_known_hosts before calling the git module, with the following command: ssh-keyscan remote_host.com >> /etc/ssh/ssh_known_hosts.

EXAMPLES
# Example git checkout from Ansible Playbooks
- git: repo=git://foosball.example.org/path/to/repo.git
       dest=/srv/checkout
       version=release-0.22
# Example read-write git checkout from github
- git: repo=ssh://git@github.com/mylogin/hello.git dest=/home/mylogin/hello
# Example just ensuring the repo checkout exists
- git: repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout update=no

AUTHOR
Michael DeHaan

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#git