diff --git a/docs/docsite/rst/porting_guide_2.3.rst b/docs/docsite/rst/porting_guide_2.3.rst index 8b096e0ca6..7b8273b51f 100644 --- a/docs/docsite/rst/porting_guide_2.3.rst +++ b/docs/docsite/rst/porting_guide_2.3.rst @@ -213,10 +213,10 @@ Will result in: delegate_to vs ProxyCommand --------------------------- -The new connection framework for Network Modules in Ansible 2.3 no longer supports the use of the -``delegate_to`` directive. In order to use a bastion or intermediate jump host -to connect to network devices, network modules now support the use of -``ProxyCommand``. +The new connection framework for Network Modules in Ansible 2.3 that uses ``cli`` transport +no longer supports the use of the ``delegate_to`` directive. +In order to use a bastion or intermediate jump host to connect to network devices over ``cli`` +transport, network modules now support the use of ``ProxyCommand``. To use ``ProxyCommand`` configure the proxy settings in the Ansible inventory file to specify the proxy host. diff --git a/lib/ansible/plugins/action/eos.py b/lib/ansible/plugins/action/eos.py index b6cd22dc55..a9cc4a359a 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -37,16 +37,16 @@ except ImportError: class ActionModule(_ActionModule): def run(self, tmp=None, task_vars=None): - if self._play_context.connection != 'local': + provider = load_provider(eos_provider_spec, self._task.args) + transport = provider['transport'] or 'cli' + + if self._play_context.connection != 'local' and transport == 'cli': return dict( failed=True, msg='invalid connection specified, expected connection=local, ' 'got %s' % self._play_context.connection ) - provider = load_provider(eos_provider_spec, self._task.args) - transport = provider['transport'] or 'cli' - display.vvvv('connection transport is %s' % transport, self._play_context.remote_addr) if transport == 'cli': diff --git a/lib/ansible/plugins/action/nxos.py b/lib/ansible/plugins/action/nxos.py index 4bd4a0e0b1..0b3ea4d114 100644 --- a/lib/ansible/plugins/action/nxos.py +++ b/lib/ansible/plugins/action/nxos.py @@ -37,16 +37,16 @@ except ImportError: class ActionModule(_ActionModule): def run(self, tmp=None, task_vars=None): - if self._play_context.connection != 'local': + provider = load_provider(nxos_provider_spec, self._task.args) + transport = provider['transport'] or 'cli' + + if self._play_context.connection != 'local' and transport == 'cli': return dict( failed=True, msg='invalid connection specified, expected connection=local, ' 'got %s' % self._play_context.connection ) - provider = load_provider(nxos_provider_spec, self._task.args) - transport = provider['transport'] or 'cli' - display.vvvv('connection transport is %s' % transport, self._play_context.remote_addr) if transport == 'cli':