Install Git With Ansible on Ubuntu Server 20.04

This blog post will show you how to install Git latest version on a Ubuntu Server 20.04 using an Ansible playbook.

Git

Git is open-source software that tracks changes of files and also known as a distributed version control system. Git was released in 2005, and the latest version is 2.31 (April 2021).

Configuration

The following playbook, will install Git using the apt get Ansible module.

---
- hosts: servers
  tasks:
    - name: Update repository
      apt_repository:
       repo: 'ppa:git-core/ppa'
       state: present
    - name: Install git
      apt:
       name: git
       state: present
       update_cache: yes

For more Ansible articles please visit the Ansible category page.

Processing…
Success! You're on the list.

Posted

in

,

by