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

Merge pull request #9814 from ccciudatu/devel

run_once tasks are skipped without checking the delegate_to host #9784
This commit is contained in:
Toshio Kuratomi 2015-01-07 09:33:21 -08:00
commit 6305864cca

View file

@ -1461,9 +1461,15 @@ class Runner(object):
# Expose the current hostgroup to the bypassing plugins # Expose the current hostgroup to the bypassing plugins
self.host_set = hosts self.host_set = hosts
# We aren't iterating over all the hosts in this # We aren't iterating over all the hosts in this
# group. So, just pick the first host in our group to # group. So, just choose the "delegate_to" host if that is defined and is
# one of the targeted hosts, otherwise pick the first host in our group to
# construct the conn object with. # construct the conn object with.
result_data = self._executor(hosts[0], None).result if self.delegate_to is not None and self.delegate_to in hosts:
host = self.delegate_to
else:
host = hosts[0]
result_data = self._executor(host, None).result
# Create a ResultData item for each host in this group # Create a ResultData item for each host in this group
# using the returned result. If we didn't do this we would # using the returned result. If we didn't do this we would
# get false reports of dark hosts. # get false reports of dark hosts.