mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Warn if something loaded by vars_files is not a dictionary
This commit is contained in:
parent
279b5965b8
commit
15b2b3a020
1 changed files with 3 additions and 1 deletions
|
@ -217,5 +217,7 @@ class Play(object):
|
||||||
fpath = utils.path_dwim(self.playbook.basedir, filename2)
|
fpath = utils.path_dwim(self.playbook.basedir, filename2)
|
||||||
new_vars = utils.parse_yaml_from_file(fpath)
|
new_vars = utils.parse_yaml_from_file(fpath)
|
||||||
if new_vars:
|
if new_vars:
|
||||||
|
if type(new_vars) != dict:
|
||||||
|
raise errors.AnsibleError("files specified in vars_files must be a YAML dictionary: %s" % fpath)
|
||||||
self.playbook.SETUP_CACHE[host].update(new_vars)
|
self.playbook.SETUP_CACHE[host].update(new_vars)
|
||||||
#else: could warn if vars file contains no vars.
|
|
||||||
|
|
Loading…
Reference in a new issue