- Install Ansible
bash <(curl -s https://raw.githubusercontent.com/xhilmi/ansible/master/install.sh)
- Setup file
ansible.cfg
andhosts
- save into $HOME for
user
- save into /etc/ansible/ for
root
ansible-config init --disabled -t all > ansible.cfg
[master_node]
38.1.1.1
[worker_node_a]
38.2.2.2
[worker_node_b]
38.3.3.3
[kubernetes:children]
master_node
worker_node
[worker_node:children]
worker_node_a
worker_node_b
- On your local machine run ssh-copy-id
ssh-copy-id user@38.1.1.1
ssh-copy-id user@38.2.2.2
ssh-copy-id user@38.3.3.3
ansible -i hosts all -m ping
ansible -i hosts master-node -m ping
ansible -i hosts worker-node -m ping
ansible -i hosts kubernetes -m ping