问题原文
原帖链接 · Elrond · CC BY-SA 3.0
We can use gather_subset at play level.
Is it possible to use it on a per host level? Like putting it in a host_vars file?
My quick testing on 2.2.1.0 did not work out.
My problem at hand: I have a host, for which get_cpu_facts fails. And really, I never need hardware facts for this host, so I would like to put "!hardware" in its gather_subset.
已采纳解答
原帖链接 · Konstantin Suvorov · CC BY-SA 3.0
AFAIK you can't set gather_subset per host if you use automatic fact gathering at play start.
But you can disable automatic fact gathering and call setup manually with required parameters (which can be supplied from host vars):
---
- hosts: all
gather_facts: no
pre_tasks:
- setup:
gather_subset: "{{ gather_subset | default(omit) }}"
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
