mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
Move networking provider options to subspec (#28894)
* Add EOS provider options as subspec * Add IOS provider options as subspec * Add IOS XR provider options as subspec * Add Junos provider options as subspec * Add NX-OS provider options as subspec * Add Vyos provider options as subspec * Remove password checks from check_args * Do the same to aireos, aruba, ce, dellos*, & sros, as they work the same way * VyOS does not support `transport`
This commit is contained in:
parent
3334407c71
commit
de2096e3d0
14 changed files with 66 additions and 101 deletions
|
@ -39,7 +39,7 @@ from ansible.module_utils.urls import fetch_url
|
|||
|
||||
_DEVICE_CONNECTION = None
|
||||
|
||||
nxos_argument_spec = {
|
||||
nxos_provider_spec = {
|
||||
'host': dict(),
|
||||
'port': dict(type='int'),
|
||||
|
||||
|
@ -51,9 +51,12 @@ nxos_argument_spec = {
|
|||
'validate_certs': dict(type='bool'),
|
||||
'timeout': dict(type='int'),
|
||||
|
||||
'provider': dict(type='dict'),
|
||||
'transport': dict(choices=['cli', 'nxapi'])
|
||||
}
|
||||
nxos_argument_spec = {
|
||||
'provider': dict(type='dict', options=nxos_provider_spec),
|
||||
}
|
||||
nxos_argument_spec.update(nxos_provider_spec)
|
||||
|
||||
# Add argument's default value here
|
||||
ARGS_DEFAULT_VALUE = {
|
||||
|
@ -66,7 +69,6 @@ def get_argspec():
|
|||
|
||||
|
||||
def check_args(module, warnings):
|
||||
provider = module.params['provider'] or {}
|
||||
for key in nxos_argument_spec:
|
||||
if module._name == 'nxos_user':
|
||||
if key not in ['password', 'provider', 'transport'] and module.params[key]:
|
||||
|
@ -82,11 +84,6 @@ def check_args(module, warnings):
|
|||
if not module.params.get(key, None):
|
||||
module.params[key] = ARGS_DEFAULT_VALUE[key]
|
||||
|
||||
if provider:
|
||||
for param in ('password',):
|
||||
if provider.get(param):
|
||||
module.no_log_values.update(return_values(provider[param]))
|
||||
|
||||
|
||||
def load_params(module):
|
||||
provider = module.params.get('provider') or dict()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue