mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11:25 -07:00
Add $LOOKUP(<lookup plugin>,<data>) as a templating option
Also moves file and pipe to lookup_plugins.
This commit is contained in:
parent
176cc8380b
commit
47082a9171
6 changed files with 113 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue