From cda3e001c6b4a0aefc31f675df4f4411c560929a Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 23 Mar 2017 15:05:11 -0400 Subject: [PATCH] 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 --- lib/ansible/plugins/action/junos.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/plugins/action/junos.py b/lib/ansible/plugins/action/junos.py index ca00916bf52..8b0b975c978 100644 --- a/lib/ansible/plugins/action/junos.py +++ b/lib/ansible/plugins/action/junos.py @@ -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