Member-only story

Checkout git repository via SSH — Ansible module git

How to checkout a git repository via SSH using Ansible module git.

Luca Berton
3 min readSep 16, 2021

How to checkout git repository via SSH?

I’m going to show you a live demo with some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot

Ansible checkout git repository

Today we’re talking about Ansible module git.
The full name is ansible.builtin.git which means is part of the collection of modules “builtin” with ansible and shipped with it.
This module is pretty stable and out for years.
The purpose is to Deploy software (or files) from git checkouts in our managed hosts.

Parameters and Return Values

The parameter list is pretty wide but I’ll summarize the most useful.

  • repo path
  • dest string
  • update boolean
  • key_file path — SSH private key

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet