mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-06 00:14:02 -07:00
netconfig module updated to pay attention to .ssh/config (#23876)
This commit is contained in:
parent
b9762b52af
commit
54c50cc983
1 changed files with 6 additions and 1 deletions
|
@ -85,6 +85,10 @@ class Connection(Rpc, ConnectionBase):
|
||||||
if not network_os:
|
if not network_os:
|
||||||
raise AnsibleConnectionFailure('Unable to automatically determine host network os. Please ansible_network_os value')
|
raise AnsibleConnectionFailure('Unable to automatically determine host network os. Please ansible_network_os value')
|
||||||
|
|
||||||
|
ssh_config = os.getenv('ANSIBLE_NETCONF_SSH_CONFIG', False)
|
||||||
|
if ssh_config == 'True':
|
||||||
|
ssh_config = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._manager = manager.connect(
|
self._manager = manager.connect(
|
||||||
host=self._play_context.remote_addr,
|
host=self._play_context.remote_addr,
|
||||||
|
@ -96,7 +100,8 @@ class Connection(Rpc, ConnectionBase):
|
||||||
look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS,
|
look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS,
|
||||||
allow_agent=self.allow_agent,
|
allow_agent=self.allow_agent,
|
||||||
timeout=self._play_context.timeout,
|
timeout=self._play_context.timeout,
|
||||||
device_params={'name': network_os}
|
device_params={'name': network_os},
|
||||||
|
ssh_config=ssh_config
|
||||||
)
|
)
|
||||||
except SSHUnknownHostError as exc:
|
except SSHUnknownHostError as exc:
|
||||||
raise AnsibleConnectionFailure(str(exc))
|
raise AnsibleConnectionFailure(str(exc))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue