Skip to main content

ansible

apt update && apt upgrade -y && apt autoremove -y && reboot
apt update
apt install software-properties-common -y
apt-add-repository --yes --update ppa:ansible/ansible
apt install python-argcomplete
vim /etc/ansible/hosts
[master]
apu03.home

[k8s]
apu[03:06].home

[nodes]
apu[04:06].home
useradd -m ansible
usermod -a -G sudo ansible
su - ansible
bash
ssh-keygen
usermod --shell /bin/bash ansible

echo "ansible ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ansible
sudo chmod 0440 /etc/sudoers.d/ansible

passwd ansible
vim .ssh/id_rsa.pub
mkdir .ssh
vim .ssh/authorized_keys