mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 16:06:43 +00:00
Merge pull request #2899 from sergevanginderachter/host-group-vars-no-subdirs
don't parse subdirs in host/group_vars
This commit is contained in:
@@ -47,7 +47,7 @@ class VarsModule(object):
|
||||
p = os.path.join(basedir, "group_vars/%s" % x)
|
||||
paths = [p, '.'.join([p, 'yml']), '.'.join([p, 'yaml'])]
|
||||
for path in paths:
|
||||
if os.path.exists(path):
|
||||
if os.path.exists(path) and not os.path.isdir(path):
|
||||
data = utils.parse_yaml_from_file(path)
|
||||
if type(data) != dict:
|
||||
raise errors.AnsibleError("%s must be stored as a dictionary/hash" % path)
|
||||
@@ -57,7 +57,7 @@ class VarsModule(object):
|
||||
p = os.path.join(basedir, "host_vars/%s" % host.name)
|
||||
paths = [p, '.'.join([p, 'yml']), '.'.join([p, 'yaml'])]
|
||||
for path in paths:
|
||||
if os.path.exists(path):
|
||||
if os.path.exists(path) and not os.path.isdir(path):
|
||||
data = utils.parse_yaml_from_file(path)
|
||||
if type(data) != dict:
|
||||
raise errors.AnsibleError("%s must be stored as a dictionary/hash" % path)
|
||||
|
||||
Reference in New Issue
Block a user