Level 1
0 / 100 XP

Installing Ansible on Linux

In this lesson, you'll learn how to install Ansible on your ansible-controller VM that you set up in the previous lessons. Additionally, if you are using a Linux-based host computer, the process to install Ansible directly on your host will be similar. By the end of this lesson, you'll have Ansible installed and ready for automation tasks.

Preparing for Installation

Before installing Ansible, make sure your system is up to date. Open a terminal on your Ansible Controller VM or your Linux host and run the following commands:

Bash
sudo apt update sudo apt upgrade

Installing Ansible

  1. Add Ansible's Official PPA (Personal Package Archive) : Ansible can be installed from its official PPA, which often contains the latest version compared to what might be in the default repositories. On your Ansible Controller VM or Linux host, add the PPA by typing:
sudo apt-add-repository ppa:ansible/ansible
  1. Update Your Package List : After adding the PPA, update your package list to include the newly added repository:
sudo apt update
  1. Install Ansible : Now, you can install Ansible with:
sudo apt install ansible

This command will install Ansible and any required dependencies.

  1. Verify the Installation : Once the installation is complete, you can verify it by checking the Ansible version:
ansible --version

This command should return the version of Ansible that was installed, confirming that the installation was successful as shown below:

Text
ansible [core 2.15.8] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/paulh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/paulh/.ansible/collections:/usr/share/ansible/collections ex…