In this lab, you will learn how to install Ansible on your designated machine (ansible-machine
).
Estimated Time: 20 minutes
- Open Google Chrome on your computer.
- Navigate to the
<Ansible Lab>
link provided by your instructor. We’ll refer to it asansible-machine
. - Click on the option labeled Secure Access via HTTPS (Recommended).
- Enter the provided password to log in and access the desktop environment.
- Open a terminal window.
- In the terminal, check if Ansible is already installed by running the following command:
ansible --version
- If Ansible is not installed, you will see a response indicating that the command is not recognized.
- Update the system packages:
sudo apt-get update
- Install the required dependencies:
sudo apt-get install software-properties-common
- Add the Ansible repository:
sudo apt-add-repository --yes --update ppa:ansible/ansible
- Install Ansible:
sudo apt-get install ansible
- Verify the installation by checking the Ansible version:
ansible --version
You should see output similar to the following:
ansible 2.12.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/ubuntu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]
Note: The version number and Python version may vary depending on your system.
To keep commands as simple as possible, we'll use nano
$ sudo apt-get install nano -y
Congratulations! 🎉 You have successfully installed Ansible on your ansible-machine
.