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.network_os = 'junos'
pc.remote_addr = provider['host'] or self._play_context.remote_addr
if self._task.action == 'junos_netconf':
pc.connection = 'network_cli'
pc.port = provider['port'] or self._play_context.port or 22