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

fixes issue when host is defined in provider for junos (#22918)

The junos action handler was not honoring the host value in the provider
argument.  This patch will now use the provider host entry if it exists
and falls back to the inventory hostname
This commit is contained in:
Peter Sprygada 2017-03-23 15:05:11 -04:00 committed by GitHub
parent 9810429f5b
commit cda3e001c6

View file

@ -57,6 +57,8 @@ class ActionModule(_ActionModule):
pc = copy.deepcopy(self._play_context) pc = copy.deepcopy(self._play_context)
pc.network_os = 'junos' pc.network_os = 'junos'
pc.remote_addr = provider['host'] or self._play_context.remote_addr
if self._task.action == 'junos_netconf': if self._task.action == 'junos_netconf':
pc.connection = 'network_cli' pc.connection = 'network_cli'
pc.port = provider['port'] or self._play_context.port or 22 pc.port = provider['port'] or self._play_context.port or 22