# (developery/technical) with\_items + vars\_files improvements, internals of SETUP\_CACHE

**URL:** <https://forum.ansible.com/t/developery-technical-with-items-vars-files-improvements-internals-of-setup-cache/11681>\
**Category:** Ansible Project\
**Created:** [July 14, 2012, 6:02pm UTC](https://forum.ansible.com/t/developery-technical-with-items-vars-files-improvements-internals-of-setup-cache/11681 "2012-07-14T18:02:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 14, 2012, 6:02pm UTC](https://forum.ansible.com/t/developery-technical-with-items-vars-files-improvements-internals-of-setup-cache/11681/1 "2012-07-14T18:02:30Z")

</div>

Sorry, this is way too filled with jargon, so I'm only going to mention it here once, and it's not something I even need to put in the docs. However, I know people on IRC  
used to help people with this, so I wanted to share.

As long as your path to something with vars\_files doesn't have a host specific fact in it, it is now possible to use vars\_files and with\_items in conjunction.

When there is a problem, ansible will tell you which variable is unbound as well. It didn't do this before.

You can't use host specific facts though, so having vars\_files load a file based on your IP address is doable, but if you do that, you can't use the variables produced  
by those vars\_files imports (with your IP address in it as a variable), because the tasks were precomputed before that happened.

For folks interested in internals, ansible is now smart enough to know when something in vars\_files contains variables that are fact related or not, and also consumes a bit less RAM thinking about things in vars\_files, as those variables are no longer duplicated per host.

Variable scoping should be a much less frequent question now.

With all of this work done, I can now also make the fact (setup) step completely optional, which I'm going to file a ticket for.

As a other technically confusing note, when we have apt-and-yum process with\_items all in one giant hop (super streamlined one-step package install for multiple packages), those will operate differently enough too, and \*WILL\* be able to be used with host specific facts. To do this though, I first need those modules tweaked to support taking comma delimited lists of package specifications.

--Michael
