Setting up Ansible.
- Ansible - Ansible is an open-source software provisioning, configuration management, and application-deployment tool.
- Docker - Is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers.
- SSH - Uses encryption to secure the connection between a client and a server.
-
Copy the hosts sample file to a real one.
cp hosts.sample hosts
-
Add pi IP address to hosts file.
-
Generate SSH keys.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
-
Copy public key of ansible user to remote machine.
cat ~/.ssh/id_rsa.pub | ssh username@ip_address 'cat >> ~/.ssh/authorized_keys'
-
Run ansible container
docker run --rm -it -v your_directory_location:/ansible willhallonline/ansible:latest /bin/sh
-
Copy the hosts sample file to a real one.
cp hosts.sample hosts
-
Add pi IP address to hosts file.
-
Generate SSH keys.
ssh-keygen -t rsa -b 4096 -C username@email.com
-
Send SSH keys to server.
cat ~/.ssh/id_rsa.pub | ssh username@server "cat >> ~/.ssh/authorized_keys"
ansible all -i hosts -m ping -u username