This adds an additional tasks to gather relevant facts if the corresponding keys (i.e. distribution, distribution_version, distribution_major_version, os_family) are not already present in the ansible_facts dict.
One could also add when: ansible_facts_fqdn is not defined ....
However, this is not always required (e.g. when using the role ipaclient only tasks/install.yml uses ansible_facts.fqdn) and ansible_facts.fqdn will always be preset after using ansible.builtin.setup with gather_subset: min.
This adds an additional tasks to gather relevant facts if the corresponding keys (i.e.
distribution
,distribution_version
,distribution_major_version
,os_family
) are not already present in theansible_facts
dict.Since the documentation does not mention that fact gathering is required before using certain roles, this prevents errors such as https://github.com/freeipa/ansible-freeipa/issues/962
One could also add
when: ansible_facts_fqdn is not defined ...
.However, this is not always required (e.g. when using the role
ipaclient
onlytasks/install.yml
usesansible_facts.fqdn
) andansible_facts.fqdn
will always be preset after usingansible.builtin.setup
withgather_subset: min
.