mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -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
|
@ -38,16 +38,19 @@ JSON_ACTIONS = frozenset(['merge', 'override', 'update'])
|
|||
FORMATS = frozenset(['xml', 'text', 'json'])
|
||||
CONFIG_FORMATS = frozenset(['xml', 'text', 'json', 'set'])
|
||||
|
||||
junos_argument_spec = {
|
||||
junos_provider_spec = {
|
||||
'host': dict(),
|
||||
'port': dict(type='int'),
|
||||
'username': dict(fallback=(env_fallback, ['ANSIBLE_NET_USERNAME'])),
|
||||
'password': dict(fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD']), no_log=True),
|
||||
'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'),
|
||||
'timeout': dict(type='int'),
|
||||
'provider': dict(type='dict'),
|
||||
'transport': dict()
|
||||
}
|
||||
junos_argument_spec = {
|
||||
'provider': dict(type='dict', options=junos_provider_spec),
|
||||
}
|
||||
junos_argument_spec.update(junos_provider_spec)
|
||||
|
||||
# Add argument's default value here
|
||||
ARGS_DEFAULT_VALUE = {}
|
||||
|
@ -58,7 +61,6 @@ def get_argspec():
|
|||
|
||||
|
||||
def check_args(module, warnings):
|
||||
provider = module.params['provider'] or {}
|
||||
for key in junos_argument_spec:
|
||||
if key not in ('provider',) and module.params[key]:
|
||||
warnings.append('argument %s has been deprecated and will be '
|
||||
|
@ -71,11 +73,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 _validate_rollback_id(module, value):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue