possible to run playbooks in offline mode?

136 views
Skip to first unread message

ne...@neilsouza.com

unread,
Dec 7, 2016, 9:31:02 AM12/7/16
to Ansible Project
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 and setup... 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.

Kai Stian Olstad

unread,
Dec 8, 2016, 1:43:53 AM12/8/16
to ansible...@googlegroups.com
On 06.12.2016 14:39, ne...@neilsouza.com wrote:
> 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.


> 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).

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.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages