Operating system family

We have looked at the setup module in previous chapters; this is the module that gathers facts about our target hosts. One of these facts is ansible_os_family; this tells us the type of operating system we are running. Let's check on both of our boxes:

$ ansible -i production centos -m setup | grep ansible_os_family$ ansible -i production ubuntu -m setup | grep ansible_os_family

As you can see from the following Terminal output, the CentOS box returns Red Hat, which is expected. However, the Ubuntu box does not return any information:

Let's take a look at why this is. First of all, we can rerun the command, but this ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.