How to Install Ansible in Ubuntu
August 11, 2023 2023-08-18 7:30How to Install Ansible in Ubuntu
How to Install Ansible in Ubuntu
What is Ansible?
Ansible is used to manage huge group of computers system. It is an open soure software. It simplies the process of cloud provisioning, configuration management, deployment of application and other tasks.
Now lets see how to install ansible in ubuntu:
- Open a terminal on your Ubuntu system.
- Update the package list to ensure you have the latest information about available packages.
- Installs the software-properties-common package, which provides a set of common utilities for managing software repositories.
- Adds the Ansible PPA to your list of software sources. The –yes flag automatically confirms any prompts, and the –update flag makes sure that the package list is updated after adding the repository.
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository --yes --update ppa:ansible/ansible
The above commands provide the output as below.
Now you can proceed to install Ansible using the following command:
$ sudo apt install ansible
After installed the Anisble sometime you may get an error when you check the Ansible version or use Ansible command:
ERROR: Ansible requires the locale encoding to be UTF-8; Detected ISO8859-1.
ansible --version
ansible [core 2.15.2]
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.6 (main, Nov 14 2022, 16:10:14) GCC 11.3.0
jinja version = 3.0.3
libyaml = True
Just make sure that everything is working fine with the command below,
ansible -m ping localhost
The Ansible PPA provides a way to get the latest version of Ansible on your Ubuntu system. This can be useful if you need features or bug fixes that might not be available in the default Ubuntu repositories.