An example of how to get the IP address of another host from the "hosts" file by performing a task on another host. server1 – our Playbook will be executed on it server2 – we need its IP address in the Playbook hosts: In order to get the IP address, we will …
Continue reading "Ansible – Get the IP address of another host from the hosts file"
There is a "hosts" file in which there is a group of "db". These are database instances that play a different role. The goal is to add the role type to the "hosts" file, so that later we can use this value in a loop that will be executed on a completely different host, …
Continue reading "Ansible – Use values in a loop from hosts file on another host"
There is a "hosts" file in which in the "db" group there are N number of hosts, you need to automatically set a variable in the playbook equal to the number of hosts in a particular group hosts example.yaml