I have confirmed that:
* playbooks now substitute inventory variables
* playbook templates can see facts
In fixing this -- I'm actually pretty happy about this -- all the stupid ways we figure out what template dictionary to use on what were able to be cleaned up, so there is just one place that dictionary is built -- executor_internal_inner in Runner.py. This will result in even more consistent tempting behavior. For instance, I caught that you probably couldn't use the "groups" hash in a template, and fixed that.
One small incompatible note -- previously groups magic variable returned a list of hashes like:
groups = {
groupname1 : {
hostname1: { all facts for this host }
},
}
This passed my code review radar initialy and needed to be fixed for a few reasons.
One, this was totally redundant with "hostvars" and duplicated a copy of all the variables in the template dictionary, which is a waste of RAM and processing really.
Two, more so, it was calling the "get_variables" function on a host way too much, which would have been pretty slow.
So it's now just:
groups = {
groupname1: [ hostname1, hostname2, hostname3 ],
groupname2: [ … ]
}
Anyway, I *THINK* all issues are resolved, but help testing is welcome -- I'm going to test more on my end and if you don't hear from me, consider that a good thing.
--Michael