diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py index bbec4d5fdc..af28114a20 100644 --- a/lib/ansible/playbook/__init__.py +++ b/lib/ansible/playbook/__init__.py @@ -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)