# possible to run playbooks in offline mode?

**URL:** <https://forum.ansible.com/t/possible-to-run-playbooks-in-offline-mode/23181>\
**Category:** Ansible Project\
**Created:** [December 6, 2016, 1:39pm UTC](https://forum.ansible.com/t/possible-to-run-playbooks-in-offline-mode/23181 "2016-12-06T13:39:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil1](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@neil1](https://forum.ansible.com/u/neil1)\
**Post date:** [December 6, 2016, 1:39pm UTC](https://forum.ansible.com/t/possible-to-run-playbooks-in-offline-mode/23181/1 "2016-12-06T13:39:17Z")

</div>

is it possible to run playbooks in an “offline” mode where setup wouldn’t make any remote requests, leaving out any facts that require it?

we sometimes have limited internet connectivity and playbooks that are only doing local work will hang on setup. running with `gather_facts = false` allows the playbook to execute, but then conditionals that check `ansible_distribution` fail, even though we can’t need internet access to figure that out.

i’ve read about `gather_subset` at [configuration](http://docs.ansible.com/ansible/intro_configuration.html) and [setup](http://docs.ansible.com/ansible/setup_module.html)… maybe that’s what `!network` does? it’s not clear from the documentation (just says “gather network facts” as far as i can find).

thanks.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 8, 2016, 6:43am UTC](https://forum.ansible.com/t/possible-to-run-playbooks-in-offline-mode/23181/2 "2016-12-08T06:43:07Z")

</div>

> is it possible to run playbooks in an "offline" mode where setup wouldn't  
> make any remote requests, leaving out any facts that require it?
> 
> we sometimes have limited internet connectivity and playbooks that are only  
> doing local work will hang on setup. running with `gather_facts = false`  
> allows the playbook to execute, but then conditionals that check  
> `ansible_distribution` fail, even though we can't need internet access to  
> figure that out.

Take a look into facts caching  
[https://docs.ansible.com/ansible/playbooks\_variables.html#fact-caching](https://docs.ansible.com/ansible/playbooks_variables.html#fact-caching).

> i've read about `gather_subset` at configuration  
> \<[http://docs.ansible.com/ansible/intro\_configuration.html&gt](http://docs.ansible.com/ansible/intro_configuration.html&gt); and setup  
> \<[http://docs.ansible.com/ansible/setup\_module.html&gt;\.\.\](http://docs.ansible.com/ansible/setup_module.html&gt;%5C.%5C.%5C). maybe that's what  
> `!network` does? it's not clear from the documentation (just says "gather  
> network facts" as far as i can find).

Facts is gathered from the remote host so connectivity is needed.  
network is just facts about the network on the remote host, all the other would need to connect to gathers the facts anyway, so !network would not make any difference.
