我如何使用Ansible事实?

huangapple go评论70阅读模式
英文:

How do I use Ansible facts?

问题

一些使用ansible_facts["os_name"],而其他人使用ansible_os_family来检查操作系统的不同方法。有没有一个首选的方法?

英文:

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?

答案1

得分: 1

... 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

英文:

> ... 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

huangapple
  • 本文由 发表于 2023年5月14日 00:23:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76243774.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定