在容器的伟大之处:Kubenetes集群和NFS存储教程中创建了一个Kubernetes集群后,我现在希望能够通过Ansible解决这些计算机。
为此需要一个新的钥匙。
$ 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
现在可以按以下方式检查配置。
$ ansible all -m ping --ssh-common-args='-o StrictHostKeyChecking=no'
现在你可以执行playbooks或命令,例如重新启动所有服务器。
$ ansible raspi -m shell -a 'sudo /sbin/reboot'