- Reference: Stackoverflow
set_fact module only sets facts available during a run. For persistent facts, you’ll need to either:
- define them in one of the following:
- Assign them to hosts using your language of choice via Ansible’s Dynamic Inventory:
The latter is what I usually choose to do, as it is quite simple to set up, and the facts are always available on all hosts, even if you are doing something like:
- getting all the facts for all the hosts while connected to a nagios host in order to generate its configuration files.
As always, if you have any questions or have a topic that you would like me to discuss, please feel free to post a comment at the bottom of this blog entry, e-mail at email@example.com, or drop me a message on Twitter (@OzNetNerd).
Note: This website is my personal blog. The opinions expressed in this blog are my own and not those of my employer.