mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #5259 from mvo5/bugfix/improve-error-on-invalid-vars-file
improve error on invalid vars file (if its a list instead of a dict)
This commit is contained in:
commit
ea8cd62b19
1 changed files with 2 additions and 0 deletions
|
@ -188,6 +188,8 @@ class Play(object):
|
|||
if os.path.isfile(vars):
|
||||
vars_data = utils.parse_yaml_from_file(vars)
|
||||
if vars_data:
|
||||
if not isinstance(vars_data, dict):
|
||||
raise errors.AnsibleError("vars from '%s' are not a dict" % vars)
|
||||
role_vars = utils.combine_vars(vars_data, role_vars)
|
||||
defaults = self._resolve_main(utils.path_dwim(self.basedir, os.path.join(role_path, 'defaults')))
|
||||
defaults_data = {}
|
||||
|
|
Loading…
Reference in a new issue