git
!git
Category: files
Clone or update a git repository on the target. Idempotent — compares local HEAD/branch against remote and updates only when needed. SSH key auth only.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
repo | string | yes | Repository URL (https/http or ssh style). |
path | path | yes | Remote destination directory for the checkout. |
branch | string | no | Branch to checkout/switch to. Default main. |
ssh_options | map | no | Map of extra SSH options passed as -o KEY=VALUE. |
accept_keys | bool | no | Auto-accept new SSH host keys via StrictHostKeyChecking=accept-new. Default true. |
update | bool | no | Pull from remote if local HEAD differs. Default true. |
attributes | map | no | File attributes applied to the checkout directory: owner, group, mode. |
Examples
- !git
repo: git@github.com:example/app.git
path: /srv/app
branch: release
ssh_options:
IdentityFile: ~/.ssh/deploy_key