mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 18:04:02 -07:00
changed collection arg to argregate on 2.4 network modules (#26649)
* changed collection arg to argregate on 2.4 network modules * replace users with aggregate in eos_user, junos_user, nxos_user * added version_added to places where we replaced users with aggregate in the docs * fix ios_static_route test * update tests to reference aggregate instead of collection/users
This commit is contained in:
parent
9d771f6eea
commit
8643e9cb34
42 changed files with 170 additions and 167 deletions
|
@ -34,13 +34,14 @@ description:
|
|||
defined accounts
|
||||
extends_documentation_fragment: junos
|
||||
options:
|
||||
users:
|
||||
aggregate:
|
||||
description:
|
||||
- The C(users) argument defines a list of users to be configured
|
||||
- The C(aggregate) argument defines a list of users to be configured
|
||||
on the remote device. The list of users will be compared against
|
||||
the current users and only changes will be added or removed from
|
||||
the device configuration. This argument is mutually exclusive with
|
||||
the name argument.
|
||||
version_added: "2.4"
|
||||
required: False
|
||||
default: null
|
||||
name:
|
||||
|
@ -48,7 +49,7 @@ options:
|
|||
- The C(name) argument defines the username of the user to be created
|
||||
on the system. This argument must follow appropriate usernaming
|
||||
conventions for the target device running JUNOS. This argument is
|
||||
mutually exclusive with the C(users) argument.
|
||||
mutually exclusive with the C(aggregate) argument.
|
||||
required: false
|
||||
default: null
|
||||
full_name:
|
||||
|
@ -206,8 +207,8 @@ def get_param_value(key, item, module):
|
|||
|
||||
|
||||
def map_params_to_obj(module):
|
||||
users = module.params['users']
|
||||
if not users:
|
||||
aggregate = module.params['aggregate']
|
||||
if not aggregate:
|
||||
if not module.params['name'] and module.params['purge']:
|
||||
return list()
|
||||
elif not module.params['name']:
|
||||
|
@ -216,7 +217,7 @@ def map_params_to_obj(module):
|
|||
collection = [{'name': module.params['name']}]
|
||||
else:
|
||||
collection = list()
|
||||
for item in users:
|
||||
for item in aggregate:
|
||||
if not isinstance(item, dict):
|
||||
collection.append({'username': item})
|
||||
elif 'name' not in item:
|
||||
|
@ -251,7 +252,7 @@ def main():
|
|||
""" main entry point for module execution
|
||||
"""
|
||||
argument_spec = dict(
|
||||
users=dict(type='list', aliases=['collection']),
|
||||
aggregate=dict(type='list', aliases=['collection', 'users']),
|
||||
name=dict(),
|
||||
|
||||
full_name=dict(),
|
||||
|
@ -264,7 +265,7 @@ def main():
|
|||
active=dict(default=True, type='bool')
|
||||
)
|
||||
|
||||
mutually_exclusive = [('users', 'name')]
|
||||
mutually_exclusive = [('aggregate', 'name')]
|
||||
|
||||
argument_spec.update(junos_argument_spec)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue