- ssh access from the VM where ansible playbook is run to other nodes
- python3 on all nodes
- python3
- ansible >=2.8.4
- jinja2 <3.10
- jmespath
The requirements can be installed like the following:
sudo apt install -y python3 python3-pip
sudo python3 -m pip install ansible "Jinja2>=2.10,<3.1" jmespath
Place your node names and IP addresses into hosts
. See the comments for example lines.
Edit group_vars/all.yml
.
The semantics of variables is explained in the comments.
Make sure all nodes are reachable with SSH from the ansible host and the public key (of the user running the ansible) is added.
When running for a localhost
node, one of the ways is to do this:
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N "" # if not generated yet
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
or to use ssh-agent
.
ansible-playbook -i hosts site.yml