On Tue, 27 Jan 2015 21:58 -0200, Giovanni Tirloni <
g...@gtirloni.com>
wrote:
> There is some information that I've to gather by running commands,
> because it doesn't exist as facts, and later I use set_fact to define
> facts that will be used by other tasks in calculating things.
>
> Since the command module doesn't run in check mode, I was wondering if
> I could first run a playbook to gather the facts (both automatically by
> Ansible and through my command/set_fact tasks) and use fact caching to
> later use these facts in another playbook run.
>
> I tried it and it works fine for Ansible facts (with Redis), but not
> for the facts I created with set_fact. Just wanted to check if that's
> expected, if there is a better way to do this and, finally, if anyone
> is interested in having this functionality (if it doesn't exist)?
It looks like a better way is to create a module in library/ that
outputs custom facts in JSON format. Then fact caching works fine.
Giovanni