# Want to save variable of one role so that can be used again, and not run the compelete ansible again

**URL:** <https://forum.ansible.com/t/want-to-save-variable-of-one-role-so-that-can-be-used-again-and-not-run-the-compelete-ansible-again/30545>\
**Category:** Ansible Developer\
**Created:** [June 12, 2019, 1:42pm UTC](https://forum.ansible.com/t/want-to-save-variable-of-one-role-so-that-can-be-used-again-and-not-run-the-compelete-ansible-again/30545 "2019-06-12T13:42:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_sharma](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Amit\_sharma](https://forum.ansible.com/u/Amit_sharma)\
**Post date:** [June 12, 2019, 1:42pm UTC](https://forum.ansible.com/t/want-to-save-variable-of-one-role-so-that-can-be-used-again-and-not-run-the-compelete-ansible-again/30545/1 "2019-06-12T13:42:42Z")

</div>

Hi,

I have a big Ansible with about 10+ roles in it that takes around 1 hr to run completely .  
Can some one help me how i can store all variables in a json so that i can trigger a only a failed role…

I am using hostvars[inventory\_hostname] but it have a very big json.  
I even have set gather\_facts:no still getting very larger json.

Please help out in this as it will save a lot of time in development.

thanks

---

<div class="post-metadata">

**Author:** ![James\_Tanner](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@James\_Tanner](https://forum.ansible.com/u/James_Tanner)\
**Post date:** [June 12, 2019, 1:51pm UTC](https://forum.ansible.com/t/want-to-save-variable-of-one-role-so-that-can-be-used-again-and-not-run-the-compelete-ansible-again/30545/2 "2019-06-12T13:51:39Z")

</div>

This question is better suited for the project mailing list rather than the devel list. However, I think what you are asking for could be accomplished with fact caching:

[https://docs.ansible.com/ansible/latest/plugins/cache.html](https://docs.ansible.com/ansible/latest/plugins/cache.html)
