Interaction with Git repositories.
NOTE: This modules is under heavy development and the API is subject to change.
It may be replaced with a generic VCS module if this proves viable.
Important, before using git over ssh, make sure your remote host fingerprint
exists in "~/.ssh/known_hosts" file.
https://github.com/saltstack/salt.git:
git.latest:
- rev: develop
- target: /tmp/salt
-
salt.states.git.latest(name, rev=None, target=None, runas=None, force=None, submodules=False, mirror=False, bare=False)
Make sure the repository is cloned to the given directory and is up to date
- name
- Address of the remote repository as passed to "git clone"
- rev
- The remote branch, tag, or revision ID to checkout after
clone / before update
- target
- Name of the target directory where repository is about to be cloned
- runas
- Name of the user performing repository management operations
- force
- Force git to clone into pre-existing directories (deletes contents)
- submodules
- Update submodules on clone or branch change (Default: False)
- mirror
- True if the repository is to be a mirror of the remote repository.
This implies bare, and thus is incompatible with rev.
- bare
- True if the repository is to be a bare clone of the remote repository.
This is incompatible with rev, as nothing will be checked out.
-
salt.states.git.present(name, bare=True, runas=None, force=False)
Make sure the repository is present in the given directory
- name
- Name of the directory where the repository is about to be created
- bare
- Create a bare repository (Default: True)
- runas
- Name of the user performing repository management operations
- force
- Force create a new repository into an pre-existing non-git directory (deletes contents)