英文:
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 andos_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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论