Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Ansible Setup, A Tutorial

04 Aug 2020 » ansible, system configuration, sysadmin

So the other ansible post, 2019-10-19 Setting Up Ansible, felt more like an intro into ansible with roles and was more lengthy. This one will be more based on installing python and ansible.

Installing Python 3

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.8
python3.8 --version

In ~/.bashrc, add alias python=python3.8 to the end and then export ~/.basrhc from the command line.

Installing Ansible

sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible

Problem 1 with setting up a new Management Server, Keys

Yes - I usually do all my configuration management from my laptop which is fine, but now that I have this management server I need keys going the other way to connect from the management server to all my other hosts.

Solution

A longer solution, but one I’m leaning towards is creating an ansible user on each host and adding the public key from the management server to each host.

Hosts File

/etc/ansible/hosts

© Jack Moore