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,28 +38,25 @@ from ansible.module_utils.connection import exec_command
|
|||
|
||||
_DEVICE_CONFIGS = {}
|
||||
|
||||
sros_argument_spec = {
|
||||
sros_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')
|
||||
}
|
||||
sros_argument_spec = {
|
||||
'provider': dict(type='dict', options=sros_provider_spec),
|
||||
}
|
||||
sros_argument_spec.update(sros_provider_spec)
|
||||
|
||||
|
||||
def check_args(module, warnings):
|
||||
provider = module.params['provider'] or {}
|
||||
for key in sros_argument_spec:
|
||||
if key != 'provider' and module.params[key]:
|
||||
warnings.append('argument %s has been deprecated and will be removed in a future version' % key)
|
||||
|
||||
if provider:
|
||||
for param in ('password',):
|
||||
if provider.get(param):
|
||||
module.no_log_values.update(return_values(provider[param]))
|
||||
|
||||
|
||||
def get_config(module, flags=[]):
|
||||
cmd = 'admin display-config '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue