mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
fixes eos connection checks and checks configured connection (#32828)
This change will check the configured connection first and then check the local provider values.
This commit is contained in:
parent
b9bdb05459
commit
db6a72ebf9
1 changed files with 22 additions and 21 deletions
|
@ -37,13 +37,14 @@ except ImportError:
|
||||||
class ActionModule(_ActionModule):
|
class ActionModule(_ActionModule):
|
||||||
|
|
||||||
def run(self, tmp=None, task_vars=None):
|
def run(self, tmp=None, task_vars=None):
|
||||||
|
|
||||||
|
if self._play_context.connection == 'local':
|
||||||
provider = load_provider(eos_provider_spec, self._task.args)
|
provider = load_provider(eos_provider_spec, self._task.args)
|
||||||
transport = provider['transport'] or 'cli'
|
transport = provider['transport'] or 'cli'
|
||||||
|
|
||||||
display.vvvv('connection transport is %s' % transport, self._play_context.remote_addr)
|
display.vvvv('connection transport is %s' % transport, self._play_context.remote_addr)
|
||||||
|
|
||||||
if transport == 'cli':
|
if transport == 'cli':
|
||||||
if self._play_context.connection == 'local':
|
|
||||||
pc = copy.deepcopy(self._play_context)
|
pc = copy.deepcopy(self._play_context)
|
||||||
pc.connection = 'network_cli'
|
pc.connection = 'network_cli'
|
||||||
pc.network_os = 'eos'
|
pc.network_os = 'eos'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue