Add $LOOKUP(<lookup plugin>,<data>) as a templating option

Also moves file and pipe to lookup_plugins.
This commit is contained in:
Daniel Hokka Zakrisson 2012-11-01 11:06:55 +01:00
parent 176cc8380b
commit 47082a9171
6 changed files with 113 additions and 24 deletions

View file

@ -272,18 +272,18 @@ class TestUtils(unittest.TestCase):
assert res == u'hello oh great one'
def test_varReplace_include(self):
template = 'hello $FILE(world)'
template = 'hello $FILE(world) $LOOKUP(file, world)'
res = ansible.utils.template("test", template, {})
assert res == u'hello world'
assert res == u'hello world world'
def test_varReplace_include_script(self):
template = 'hello $PIPE(echo world)'
template = 'hello $PIPE(echo world) $LOOKUP(pipe, echo world)'
res = ansible.utils.template("test", template, {})
assert res == u'hello world'
assert res == u'hello world world'
#####################################
### varReplaceWithItems function tests