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

Fixes #7658
pull/7650/head
James Cammarata 11 years ago
parent 8ff0c0f253
commit 82a784931e

@ -257,6 +257,10 @@ class PlayBook(object):
elif isinstance(p['vars'], list):
# nobody should really do this, but handle vars: a=1 b=2
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
p['vars_files'] = utils.list_union(p.get('vars_files', []), play_vars_files)

Loading…
Cancel
Save