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 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).


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

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

For more Ansible articles please visit the Ansible category page.

Success! You're on the list.