mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
limit extensions for files in group/host_vars dir
inventory vars: make loading from a directory obey the same rules as when checking the base paths, looking at the file name extensions as defined in CONSTANTS.YAML_FILENAME_EXTENSIONS Fixes Github issue #11017
This commit is contained in:
parent
ed4df57361
commit
b6ea8de399
1 changed files with 3 additions and 1 deletions
|
@ -1617,7 +1617,9 @@ def _load_vars_from_folder(folder_path, results, vault_password=None):
|
|||
names.sort()
|
||||
|
||||
# do not parse hidden files or dirs, e.g. .svn/
|
||||
paths = [os.path.join(folder_path, name) for name in names if not name.startswith('.')]
|
||||
paths = [os.path.join(folder_path, name) for name in names
|
||||
if not name.startswith('.')
|
||||
and os.path.splitext(name)[1] in C.YAML_FILENAME_EXTENSIONS]
|
||||
for path in paths:
|
||||
_found, results = _load_vars_from_path(path, results, vault_password=vault_password)
|
||||
return results
|
||||
|
|
Loading…
Reference in a new issue