gather_facts
除了在游戏级别之外还有其他方法可以关闭吗?如果我想永久禁用它,有没有办法在ansible.cfg
或清单文件中做到这一点?
答案1
从ansible.cfg
:
# plays will gather facts by default, which contain information about
# the remote system.
#
# smart - gather by default, but don't regather if already gathered
# implicit - gather by default, turn off with gather_facts: False
# explicit - do not gather by default, must say gather_facts: True
gathering = explicit
答案2
gather_facts
除了在游戏级别之外还有其他方法可以关闭吗?如果我想永久禁用它,有没有办法在ansible.cfg
...
是的当然。根据 Ansible 文档Ansible 配置设置有关配置文件和DEFAULT_GATHERING
放gathering = explicit
。
默认
implicit
选择
implicit
gather_facts: False
除非设置,否则缓存插件将被忽略,并且每次播放都会收集事实。explicit
除非剧中直接要求,否则不会收集事实。