Ansible facts are metadata information of managed node to which we connect. A fact can be hostname, OS family, OS Version, IP address, and generally system’s software and hardware information. Ansible facts help the admin not only to store inventory information of the infrastructure but also to manage managed nodes based on their metadata information. For example, you might want to configure BGP of your gateway routers, but the configuration will be different depending on the operating system family of the device if it is IOS or IOS XR. or you want to configure EIGRP, but the router ID and network addresses differ depending on the device name. Using ansible_facts, we can collect metadata information from managed nodes and use the when condition to apply the configuration based on these information. “ansible_facts” and ansible “when” conditions is the topic this Video.
Details