Note: No need to use when keyword here. — For doing this practical we require three operating systems, RHEL, Ubuntu and one for Controller Node. We need to have ansible installed and configured in our controller node. Here, I am using the RedHat-8 OS, For doing this practical we need to know about ansible-facts. Ansible Facts Ansible facts are data related to your remote systems, including operating systems, IP addresses, attached filesystems, and more. You can access this data in the ansible_facts variable. By default, you can also access some Ansible facts as top-level variables with the ansible_ prefix. You can disable this behavior using the INJECT_FACTS_AS_VARS setting.