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:
Michael DeHaan 2013-04-03 01:03:30 -04:00
parent aa4ad80bda
commit cdaa2085ee
5 changed files with 36 additions and 4 deletions

View file

@ -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)