Define physical_host in options

In ansible 2.12.3 change to ssh plugin has been merged [1] that
prioritize host retireved from options over play_context
In order to overcome that we override host in options as well.

[1] be19863e44

Co-Authored-By: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
Change-Id: I8fd5c70d64067646c391c6a63bc759a9d1d383d0
This commit is contained in:
Dmitriy Rabotyagov 2022-04-05 11:43:01 +02:00
parent 8b97133770
commit 18844f4fb4
1 changed files with 1 additions and 1 deletions

View File

@ -414,7 +414,7 @@ class Connection(SSH.Connection):
def _set_physical_host_addr(self, physical_host_addrs):
physical_host_addr = physical_host_addrs.get(self.physical_host,
self.physical_host)
self.host = self._play_context.remote_addr = physical_host_addr
self.host = self._options['host'] = self._play_context.remote_addr = physical_host_addr
@retry(ExceptionToCheck=Exception)
def exec_command(self, cmd, in_data=None, sudoable=True):