Flush fact cache from within playbook?

3,634 views
Skip to first unread message

Dick Visser

unread,
Jun 25, 2017, 3:23:02 AM6/25/17
to ansible...@googlegroups.com
Hi

I'm using fact caching which works great.
For a specific task in one of my playbooks I don't want to use cached
facts but "fresh" ones.
I'm aware of the --flush-cache command line option, but the playbook
in question can be included in others, so it's not always clear when
running the main playbook if the cache should be flushed. To be safe I
could just always use --flush-cache but that defeats the purpose of
cached facts.

Is there a way to flush the cache from a playbook?
Or any other suggestions for doing this (or maybe workarounds).

Thanks


--
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

Brian Coca

unread,
Jun 26, 2017, 12:35:12 PM6/26/17
to Ansible Project
http://docs.ansible.com/ansible/meta_module.html has a 'clear_facts' .


--
----------
Brian Coca

Dick Visser

unread,
Jun 26, 2017, 4:59:41 PM6/26/17
to ansible...@googlegroups.com
On 26 June 2017 at 18:35, Brian Coca <bc...@ansible.com> wrote:
> http://docs.ansible.com/ansible/meta_module.html has a 'clear_facts' .

Spot on, thanks!!
Reply all
Reply to author
Forward
0 new messages