-
-
Notifications
You must be signed in to change notification settings - Fork 0
Ansible Management
Alexander Diemand edited this page Feb 12, 2025
·
1 revision
- check your current ssh key loaded:
ssh-add -l
- outputs:
4096 SHA256:YtYvnte+NLyybBHBH54Wm+s20bQ0HpYbn/jEVh/dPjQ /home/alex/src/id_rsa (RSA)
- outputs:
- get the public key:
cat /home/alex/src/id_rsa.pub
(<-- adding.pub
)- outputs:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQ..zgVqJ91HX/w== [email protected]
- copy that whole output
- outputs:
- on each node when logged in as root:
- execute this command:
umask 077; mkdir -vp ~/.ssh; touch ~/.ssh/authorized_keys; vi ~/.ssh/authorized_keys
- press "i" and paste into the editor your public key
- press "", press ":wq" to write to the file and leave the editor
- execute this command:
- now, you should be able to login to each node as root without a password request
Create a file hosts
that contain the hostnames of your cluster's nodes:
kubian:
hosts:
kubian10:
kubian20:
kubian22:
kubian27:
kubian31:
kubian35:
ansible -i ./hosts kubian -u root -m ansible.builtin.apt -a "name=nfs-common state=present"
this will go through all hosts under kubian
in your hosts
file, and make sure that the named package is installed on each node.
ansible -i ./hosts kubian -u root -m shell -a "sed -e 's/^[^ ]\+\( \+registry.cluster\).*/10.244.6.1\1/' -i /etc/hosts"
this will set the IP address of "registry.cluster" to a new value in /etc/hosts of each node.