git
git module
Clone or update Git repositories. This module can clone repositories from remote sources and checkout specific versions, branches, or tags.
Examples
- name: Clone a repository
git:
repo: https://github.com/user/repo.git
dest: /opt/myapp
- name: Clone specific branch
git:
repo: https://github.com/user/repo.git
dest: /opt/myapp
version: develop
- name: Clone specific tag
git:
repo: https://github.com/user/repo.git
dest: /opt/myapp
version: v1.0.0
- name: Clone with SSH
git:
repo: [email protected]:user/repo.git
dest: /opt/myapp
Note: This module requires git to be installed on the target host. SSH keys must be configured for SSH repositories.
Module Capabilities
- Has Revert: true
- Provides Variables: None
Inputs
Parameter | Type | Description | Required | Default | Choices |
---|---|---|---|---|---|
dest | string | Path where the repository should be cloned or updated. | false | ||
repo | string | URL of the git repository to clone. Supports HTTP(S) and SSH protocols. | false | ||
version | string | Version to checkout. Can be a branch name, tag, or commit hash. | false | HEAD |
Outputs
No outputs.