【问题标题】:Disable Ansible gather facts from the command lineDisable Ansible gather facts from the command line
【发布时间】:2022-12-27 21:05:36
【问题描述】:

To speed up execution of Ansible playbooks, I occasionally want to disable gathering facts during the setup phase. This can be done in the playbook by adding:

gather_facts: False

but how can it be controlled in the command line?

I execute my Ansible playbook like this:

ansible-playbook playbook.yaml -i inventory.yaml

【问题讨论】:

    标签: ansible ansible-facts


    【解决方案1】:

    You can use the ANSIBLE_GATHERING environment variable:

    ANSIBLE_GATHERING=explicit ansible-playbook playbook.yaml -i inventory.yaml

    In this way, gathering facts is disabled unless the play has explicitly set gather_facts: True.

    【讨论】:

      猜你喜欢
      • 2015-04-06
      • 1970-01-01
      • 2021-12-10
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多