1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make sure 'item' variable is set when using first_available_file

Fixes #8220
This commit is contained in:
James Cammarata 2014-07-21 11:01:41 -05:00
parent 2cc602beea
commit b21875d5a9

View file

@ -257,6 +257,10 @@ class Task(object):
# make first_available_file accessable to Runner code # make first_available_file accessable to Runner code
if self.first_available_file: if self.first_available_file:
self.module_vars['first_available_file'] = self.first_available_file self.module_vars['first_available_file'] = self.first_available_file
# make sure that the 'item' variable is set when using
# first_available_file (issue #8220)
if 'item' not in self.module_vars:
self.module_vars['item'] = ''
if self.items_lookup_plugin is not None: if self.items_lookup_plugin is not None:
self.module_vars['items_lookup_plugin'] = self.items_lookup_plugin self.module_vars['items_lookup_plugin'] = self.items_lookup_plugin