Make it possible to use facts from hosts in templates for other hosts.

It works like this:

{{ hostvars['127.0.0.1']['ansible_eth0']['ipv4']['address'] }}
This commit is contained in:
Michael DeHaan
2012-04-21 12:45:37 -04:00
parent 767282df2a
commit 533c2c6126
4 changed files with 19 additions and 18 deletions

View File

@@ -30,7 +30,7 @@ import sys
import os
import subprocess
import traceback
import ansible.utils
from ansible import utils
try:
import json
@@ -70,7 +70,7 @@ try:
print "***********************************"
print "RAW OUTPUT"
print out
results = ansible.utils.parse_json(out)
results = utils.parse_json(out)
except:
print "***********************************"
@@ -82,7 +82,7 @@ except:
print "***********************************"
print "PARSED OUTPUT"
print results
print utils.bigjson(results)
sys.exit(0)