Commit 82a78493 by James Cammarata

Fix error passing play vars to an included playbook with empty vars

Fixes #7658
parent 8ff0c0f2
...@@ -257,6 +257,10 @@ class PlayBook(object): ...@@ -257,6 +257,10 @@ class PlayBook(object):
elif isinstance(p['vars'], list): elif isinstance(p['vars'], list):
# nobody should really do this, but handle vars: a=1 b=2 # nobody should really do this, but handle vars: a=1 b=2
p['vars'].extend([{k:v} for k,v in play_vars.iteritems()]) p['vars'].extend([{k:v} for k,v in play_vars.iteritems()])
elif p['vars'] == None:
# someone specified an empty 'vars:', so reset
# it to the vars we currently have
p['vars'] = play_vars.copy()
# now add in the vars_files # now add in the vars_files
p['vars_files'] = utils.list_union(p.get('vars_files', []), play_vars_files) p['vars_files'] = utils.list_union(p.get('vars_files', []), play_vars_files)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment