My Ansible Install on a PI

Useful Links:
https://geektechstuff.com/2019/06/25/installing-ansible-raspberry-pi/
https://docs.ansible.com/projects/ansible/latest/reference_appendices/config.html#ansible-configuration-settings-locations

Did the install commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt install ansible

this did not create the default directory /etc/ansible or the default config files so had to do the following:
sudo mkdir -p /etc/ansible
sudo touch /etc/ansible/ansible.cfg /etc/ansible/hosts

ansible-config init –disabled > ansible.cfg
sudo mv ansible.cfg /etc/ansible/ansible.cfg

Now check the config:
ansible –version

Now edited the hosts file for ansible
sudo pico -w /etc/ansible/hosts

and put in a test group:

[test]
192.168.0.1
192.168.0.2

errored as predicted in https://geektechstuff.com/2019/06/25/installing-ansible-raspberry-pi/ but I did not like the solution of ssh keys, so I found how to add name and password to host file:
[test]
192.168.0.212

[test:vars]
ansible_user=user
ansible_password=*******

and that worked for what I want (to be able to log into switches and routers to run commands



This entry was posted in Networking. Bookmark the permalink.