# Fact Caching doesn't appear to save all facts

**URL:** <https://forum.ansible.com/t/fact-caching-doesnt-appear-to-save-all-facts/22488>\
**Category:** Ansible Project\
**Created:** [September 5, 2016, 2:15pm UTC](https://forum.ansible.com/t/fact-caching-doesnt-appear-to-save-all-facts/22488 "2016-09-05T14:15:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Copley](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Adam\_Copley](https://forum.ansible.com/u/Adam_Copley)\
**Post date:** [September 5, 2016, 2:15pm UTC](https://forum.ansible.com/t/fact-caching-doesnt-appear-to-save-all-facts/22488/1 "2016-09-05T14:15:11Z")

</div>

I wrote a custom fact which sits on a server and pulls out an array of supervisord programs:

`

#!/usr/bin/env python2.7

import os  
import sys  
import json

# Config to read

supervisord\_config = ‘/etc/supervisord.conf’;

# Define the main function

def main():  
file\_object = open(supervisord\_config, ‘r’);

program\_list = ;

for line in file\_object:  
if “programs” not in line:  
if “program:” in line:  
programs = line.split(“:”)[1];  
programs = programs.split(“]”)[0];  
program\_list.append(programs);

print json.dumps(program\_list);

# Run the main function

if os.path.exists(supervisord\_config):  
main()  
else:  
sys.exit(1)

`

Running the setup module against the server, to be able to access the facts, this the above returns:

`

“ansible\_local”: {  
“supervisord\_default”: [  
“imageprocess”,  
“replaceimage”,  
“mobile\_imageprocess”,  
“mobile\_replaceimage”  
],  
},

`

That is correct and i can manipulate the output within tasks and templates perfectly, however i require one template to utilise facts from other servers and so i wanted to utilise the fact\_caching functionality, however the above fact doesnt appear to be stored properly in the cache:

`  
“supervisord\_default”: {},

`

That is all that the cache has..

How can i get it so that the cache has the correct data?
