mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
HTTP(S) API connection plugin (#39224)
* HTTPAPI connection * Punt run_commands to cliconf or httpapi * Fake enable_mode on eapi * Pull changes to nxos * Move load_config to edit_config for future-preparedness * Don't fail on lldp disabled * Re-enable check_rc on nxos' run_commands * Reorganize nxos httpapi plugin for compatibility * draft docs for connection: httpapi * restores docs for connection:local for eapi * Add _remote_is_local to httpapi
This commit is contained in:
parent
cc61c86049
commit
e9d7fa0418
277 changed files with 1325 additions and 1676 deletions
|
@ -43,13 +43,13 @@ class ActionModule(_ActionModule):
|
|||
|
||||
socket_path = None
|
||||
|
||||
if self._play_context.connection == 'network_cli':
|
||||
if self._play_context.connection in ('network_cli', 'httpapi'):
|
||||
provider = self._task.args.get('provider', {})
|
||||
if any(provider.values()):
|
||||
display.warning('provider is unnecessary when using network_cli and will be ignored')
|
||||
display.warning('provider is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['provider']
|
||||
if self._task.args.get('transport'):
|
||||
display.warning('transport is unnecessary when using network_cli and will be ignored')
|
||||
display.warning('transport is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['transport']
|
||||
elif self._play_context.connection == 'local':
|
||||
provider = load_provider(eos_provider_spec, self._task.args)
|
||||
|
|
|
@ -43,16 +43,17 @@ class ActionModule(_ActionModule):
|
|||
|
||||
socket_path = None
|
||||
|
||||
if self._task.args.get('provider', {}).get('transport') == 'nxapi' and self._task.action == 'nxos_nxapi':
|
||||
if (self._play_context.connection == 'httpapi' or self._task.args.get('provider', {}).get('transport') == 'nxapi') \
|
||||
and self._task.action == 'nxos_nxapi':
|
||||
return {'failed': True, 'msg': "Transport type 'nxapi' is not valid for '%s' module." % (self._task.action)}
|
||||
|
||||
if self._play_context.connection == 'network_cli':
|
||||
if self._play_context.connection in ('network_cli', 'httpapi'):
|
||||
provider = self._task.args.get('provider', {})
|
||||
if any(provider.values()):
|
||||
display.warning('provider is unnecessary when using network_cli and will be ignored')
|
||||
display.warning('provider is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['provider']
|
||||
if self._task.args.get('transport'):
|
||||
display.warning('transport is unnecessary when using network_cli and will be ignored')
|
||||
display.warning('transport is unnecessary when using %s and will be ignored' % self._play_context.connection)
|
||||
del self._task.args['transport']
|
||||
elif self._play_context.connection == 'local':
|
||||
provider = load_provider(nxos_provider_spec, self._task.args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue