8/100 Install Ansible
During the weekly meeting, the Nautilus DevOps team discussed about the automation and configuration management solutions that they want to implement. While considering several options, the team has decided to go with Ansible
for now due to its simple setup and minimal pre-requisites. The team wanted to start testing using Ansible, so they have decided to use jump host
as an Ansible controller to test different kind of tasks on rest of the servers.
Task:
Install ansible
version 4.9.0
on Jump host
using pip3
only. Make sure Ansible binary is available globally on this system, i.e all users on this system are able to run Ansible commands.
sudo pip3 install ansible==4.9.0
Collecting ansible==4.9.0
Downloading ansible-4.9.0.tar.gz (36.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36.6/36.6 MB 15.6 MB/s eta
-- snipped --
Ensure you add the correct path to ensure the sudo
user can also access ansible:
sudo visudo
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin <- Have added /usr/local/bin
sudo ansible --version
Had we ran sudo ansible --version
we wouldn't have been able to see ansible as it wasn't in the PATH. We located the path by doing the command ansible --version
as the thor users and we noted it was, therefore that is what we added the following to the sudoers file ( using sudo visudo
command as shown above):
executable location = /usr/local/bin/ansible