issue #251: ansible: watch for delegate_to during connection delegation.

This needs more work -- pretty certain that python_path and suchlike are
coming from the wrong place. Possibly we need another config_from_..()
specialized for delegate_to.
pull/350/head
David Wilson 7 years ago
parent 6c4b01642c
commit 1f21a30e7f

@ -524,13 +524,23 @@ class Connection(ansible.plugins.connection.ConnectionBase):
broker=self.broker, broker=self.broker,
) )
stack, _ = self._stack_from_config( if hasattr(self._play_context, 'delegate_to'):
config_from_play_context( target_config = config_from_hostvars(
transport=self._play_context.connection,
inventory_name=self._play_context.delegate_to,
connection=self,
hostvars=self.host_vars[self._play_context.delegate_to],
become_user=(self._play_context.become_user
if self._play_context.become
else None),
)
else:
target_config = config_from_play_context(
transport=self.transport, transport=self.transport,
inventory_name=self.inventory_hostname, inventory_name=self.inventory_hostname,
connection=self connection=self
) )
) stack, _ = self._stack_from_config(target_config)
dct = self.parent.call_service( dct = self.parent.call_service(
service_name='ansible_mitogen.services.ContextService', service_name='ansible_mitogen.services.ContextService',

Loading…
Cancel
Save