|
|
@ -21,6 +21,7 @@ import os
|
|
|
|
import glob
|
|
|
|
import glob
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.plugins.lookup import LookupBase
|
|
|
|
from ansible.plugins.lookup import LookupBase
|
|
|
|
|
|
|
|
from ansible.errors import AnsibleFileNotFound
|
|
|
|
|
|
|
|
|
|
|
|
class LookupModule(LookupBase):
|
|
|
|
class LookupModule(LookupBase):
|
|
|
|
|
|
|
|
|
|
|
@ -29,7 +30,11 @@ class LookupModule(LookupBase):
|
|
|
|
ret = []
|
|
|
|
ret = []
|
|
|
|
for term in terms:
|
|
|
|
for term in terms:
|
|
|
|
term_file = os.path.basename(term)
|
|
|
|
term_file = os.path.basename(term)
|
|
|
|
dwimmed_path = self.find_file_in_search_path(variables, 'files', os.path.dirname(term))
|
|
|
|
try:
|
|
|
|
globbed = glob.glob(os.path.join(dwimmed_path, term_file))
|
|
|
|
dwimmed_path = self.find_file_in_search_path(variables, 'files', os.path.dirname(term))
|
|
|
|
ret.extend(g for g in globbed if os.path.isfile(g))
|
|
|
|
except AnsibleFileNotFound:
|
|
|
|
|
|
|
|
dwimmed_path = None
|
|
|
|
|
|
|
|
if dwimmed_path:
|
|
|
|
|
|
|
|
globbed = glob.glob(os.path.join(dwimmed_path, term_file))
|
|
|
|
|
|
|
|
ret.extend(g for g in globbed if os.path.isfile(g))
|
|
|
|
return ret
|
|
|
|
return ret
|
|
|
|