8

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
Valerio Bozz
  • 1,176
  • 16
  • 32
Juuso Ohtonen
  • 8,826
  • 9
  • 65
  • 98

2 Answers2

10

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.

Valerio Bozz
  • 1,176
  • 16
  • 32
Juuso Ohtonen
  • 8,826
  • 9
  • 65
  • 98
-3

addinterpreter_python = /usr/bin/pyton to your ansible.cfg file