Dopo aver creato un cluster Kubernetes nel tutorial Grandi cose con i container: cluster Kubenetes e storage NFS, vorrei ora essere in grado di indirizzare questi computer tramite Ansible.
Per questo è necessaria una nuova chiave:
$ 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
Ora la configurazione può essere controllata come segue:
$ ansible all -m ping --ssh-common-args='-o StrictHostKeyChecking=no'
Ora puoi eseguire playbook o comandi, per esempio riavviare tutti i server:
$ ansible raspi -m shell -a 'sudo /sbin/reboot'