mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
fix for psuedo-connection hostvars not propagating to connection
(mostly done by jimi-c, tested working)
This commit is contained in:
parent
04ce71b4bd
commit
ece1ed09d5
3 changed files with 8 additions and 10 deletions
|
@ -409,7 +409,7 @@ class TaskExecutor:
|
|||
# get the connection and the handler for this execution
|
||||
if not self._connection or not getattr(self._connection, 'connected', False) or self._play_context.remote_addr != self._connection._play_context.remote_addr:
|
||||
self._connection = self._get_connection(variables=variables, templar=templar)
|
||||
self._connection.set_host_overrides(host=self._host)
|
||||
self._connection.set_host_overrides(host=self._host, hostvars=variables.get('hostvars', {}).get(self._host.name, {}))
|
||||
else:
|
||||
# if connection is reused, its _play_context is no longer valid and needs
|
||||
# to be replaced with the one templated above, in case other data changed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue