Requirements for all Docker Swarm cluster servers and administrator workstation.
TOC:
❗ It is recommended to disable the firewall on your VMs, to avoid various unwanted problems during installation!
Debian/Ubuntu
sudo ufw disable
RedHat/Rocky
sudo systemctl disable --now firewalld
Create new OS user for a ansible tasks on all cluster VMs:
Debian/Ubuntu
sudo adduser hladmin
RedHat/Rocky
sudo useradd hladmin
sudo passwd hladmin
Add newly created user to sudoers file (for passwordless sudo):
sudo su -
echo -e "\n# Allow without a password\nhladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
exit
Create required directory
mkdir -p ~/.ssh/
Generate new SSH key:
ssh-keygen -f ~/.ssh/id_rsa -N ""
chmod 700 ~/.ssh
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/authorized_keys
Distribute the SSH public key to all servers:
- use newly created user for ansible tasks:
ssh-copy-id [email protected]
SSH without password