Manage I(git) checkouts of repositories to deploy files or software.

Options

namedescriptionrequiredchoices
repo git, SSH, or HTTP protocol address of the git repository. true
dest Absolute path of where the repository should be checked out to. This parameter is required, unless C(clone) is set to C(no) This change was made in version 1.8.3. Prior to this version, the C(dest) parameter was always required. true
version What version of the repository to check out. This can be the full 40-character I(SHA-1) hash, the literal string C(HEAD), a branch name, or a tag name.
accept_hostkey if C(yes), adds the hostkey for the repo url if not already added. If ssh_opts contains "-o StrictHostKeyChecking=no", this parameter is ignored.
  • yes
  • no
ssh_opts Creates a wrapper script and exports the path as GIT_SSH which git then automatically uses to override ssh arguments. An example value could be "-o StrictHostKeyChecking=no"
key_file Specify an optional private key file to use for the checkout.
reference Reference repository (see "git clone --reference ...")
remote Name of the remote.
refspec Add an additional refspec to be fetched. If version is set to a I(SHA-1) not reachable from any branch or tag, this option may be necessary to specify the ref containing the I(SHA-1). Uses the same syntax as the 'git fetch' command. An example value could be "refs/meta/config".
force If C(yes), any modified files in the working repository will be discarded. Prior to 0.7, this was always 'yes' and could not be disabled. Prior to 1.9, the default was `yes`
  • yes
  • no
depth Create a shallow clone with a history truncated to the specified number or revisions. The minimum possible value is C(1), otherwise ignored.
clone If C(no), do not clone the repository if it does not exist locally
  • yes
  • no
update If C(no), do not retrieve new revisions from the origin repository
  • yes
  • no
executable Path to git executable to use. If not supplied, the normal mechanism for resolving binary paths will be used.
bare if C(yes), repository will be created as a bare repo, otherwise it will be a standard repo with a workspace.
  • yes
  • no
recursive if C(no), repository will be cloned without the --recursive option, skipping sub-modules.
  • yes
  • no
track_submodules if C(yes), submodules will track the latest commit on their master branch (or other branch specified in .gitmodules). If C(no), submodules will be kept at the revision specified by the main project. This is equivalent to specifying the --remote flag to git submodule update.
  • yes
  • no
verify_commit if C(yes), when cloning or checking out a C(version) verify the signature of a GPG signed commit. This requires C(git) version>=2.1.0 to be installed. The commit MUST be signed and the public key MUST be trusted in the GPG trustdb.
  • yes
  • no

Author

Ansible Core Team ,Michael DeHaan