diff --git a/lib/ansible/plugins/filter/core.py b/lib/ansible/plugins/filter/core.py index 8bf829afcb8..2ec50f4980d 100644 --- a/lib/ansible/plugins/filter/core.py +++ b/lib/ansible/plugins/filter/core.py @@ -126,8 +126,8 @@ def quote(a): return pipes.quote(a) def fileglob(pathname): - ''' return list of matched files for glob ''' - return glob.glob(pathname) + ''' return list of matched regular files for glob ''' + return [ g for g in glob.glob(pathname) if os.path.isfile(g) ] def regex_replace(value='', pattern='', replacement='', ignorecase=False): ''' Perform a `re.sub` returning a string '''