diff --git a/lib/ansible/plugins/vars/host_group_vars.py b/lib/ansible/plugins/vars/host_group_vars.py index 9177f27c26..73aeec881c 100644 --- a/lib/ansible/plugins/vars/host_group_vars.py +++ b/lib/ansible/plugins/vars/host_group_vars.py @@ -123,7 +123,7 @@ class VarsModule(BaseVarsPlugin): for spath in os.listdir(path): if not spath.startswith('.'): # skip hidden - ext = os.path.splitext(path)[-1] + ext = os.path.splitext(spath)[-1] full_spath = os.path.join(path, spath) if os.path.isdir(full_spath) and not ext: # recursive search if dir