After creating a Kubernetes cluster in the Great things with containers: Kubenetes cluster and NFS storage tutorial, I would now like to be able to address these machines via Ansible.
A new key is required for this:
$ ssh-keygen -b 4096
$ sudo apt-get install -y ansible
[raspi-kube.clust]
ip-server-1:ssh-port ansible_ssh_user=username
ip-server-2:ssh-port ansible_ssh_user=username
ip-server-3:ssh-port ansible_ssh_user=username
Now the configuration can be checked as follows:
$ ansible all -m ping --ssh-common-args='-o StrictHostKeyChecking=no'
Now you can run playbooks or commands, for example, reboot all servers:
$ ansible raspi -m shell -a 'sudo /sbin/reboot'