mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Return original string for non-matched vars
This commit is contained in:
parent
4399d9c3cb
commit
07ba7e2013
1 changed files with 4 additions and 1 deletions
|
@ -187,7 +187,10 @@ def varReplaceWithItems(basedir, varname, vars):
|
||||||
if not m:
|
if not m:
|
||||||
return varname
|
return varname
|
||||||
if m['start'] == 0 and m['end'] == len(varname):
|
if m['start'] == 0 and m['end'] == len(varname):
|
||||||
|
if m['replacement'] is not None:
|
||||||
return varReplaceWithItems(basedir, m['replacement'], vars)
|
return varReplaceWithItems(basedir, m['replacement'], vars)
|
||||||
|
else:
|
||||||
|
return varname
|
||||||
else:
|
else:
|
||||||
return template(basedir, varname, vars)
|
return template(basedir, varname, vars)
|
||||||
elif isinstance(varname, (list, tuple)):
|
elif isinstance(varname, (list, tuple)):
|
||||||
|
|
Loading…
Reference in a new issue