user1074593
user1074593

Reputation: 630

How do I use Ansible facts?

I see different ways of checking for the OS. Some use ansible_facts["os_name"] while others use ansible_os_family. Is there a preferred one to use?

Upvotes: 0

Views: 1624

Answers (1)

U880D
U880D

Reputation: 12142

... others use ansible_os_family. Is there a preferred one to use?

The documentation about Ansible Facts reference only os_family.

Also Getting full name of the OS using Ansible facts reference only os_family.

Based on that I would assume there is no such fact like os_name, can't be used therefore and os_familiy should be preferred.

Similar Q&A

Upvotes: 1

Related Questions