getting facts from previous plays

I’m a bit confused by the wording here:

“The hosts that you want to reference data from must be included in either the current play or any previous play”

Does that mean of any playbook, or just the same playbook?

Thanks,

James

Playbooks contain (rather, ARE) lists of plays, and can include other
playbooks. Thus anything that has a "hosts:" is it's own play, and a
playbook can include more than one of those.

So when it says plays, it means plays, not playbooks.

If the play has been executed, those facts gathered in that play are
available to subsequently executed plays.

Thanks for clearing this up for me. Makes sense now.

James

Does what you say hold true for custom facts too? This doesn’t appear to be true in my playbook: https://gist.github.com/4415483.

$mypackage_url is returned properly on the first play, but on the second play it includes nothing.

Thanks for your help,

James

James Martin wrote:

Does what you say hold true for custom facts too? This doesn't appear to
be true in my playbook: https://gist.github.com/4415483.
$mypackage_url is returned properly on the first play, but on the second
play it includes nothing.

Thanks for your help,

The local connection type uses the hostname 127.0.0.1.
${hostvars.{127.0.0.1}.mypackage_url} should work.

Daniel

The local connection type uses the hostname 127.0.0.1.
${hostvars.{127.0.0.1}.mypackage_url} should work.

I still maintain that syntax is pretty hard to read.

I think we should allow usage of Jinja2 in playbooks again.