mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Fix error passing play vars to an included playbook with empty vars
Fixes #7658
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user