mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Preliminary ability to use Jinja2 {{ }} to replace ${foo.bar} in playbooks. Can't use both at the same time per line.
This commit is contained in:
parent
aa4ad80bda
commit
cdaa2085ee
5 changed files with 36 additions and 4 deletions
|
@ -279,11 +279,12 @@ def parse_yaml_from_file(path):
|
|||
|
||||
def parse_kv(args):
|
||||
''' convert a string of key/value items to a dict '''
|
||||
|
||||
options = {}
|
||||
if args is not None:
|
||||
# attempting to split a unicode here does bad things
|
||||
vargs = shlex.split(str(args), posix=True)
|
||||
args = args.encode('utf-8')
|
||||
vargs = [x.decode('utf-8') for x in shlex.split(args, posix=True)]
|
||||
#vargs = shlex.split(str(args), posix=True)
|
||||
for x in vargs:
|
||||
if x.find("=") != -1:
|
||||
k, v = x.split("=",1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue