mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix error passing play vars to an included playbook with empty vars
Fixes #7658
This commit is contained in:
parent
8ff0c0f253
commit
82a784931e
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue