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:
David Newswanger
2017-07-26 10:09:17 -04:00
committed by Peter Sprygada
parent 9d771f6eea
commit 8643e9cb34
42 changed files with 170 additions and 167 deletions

View File

@@ -35,17 +35,18 @@ description:
configuration that are not explicitly defined.
extends_documentation_fragment: eos
options:
users:
aggregate:
description:
- The set of username objects to be configured on the remote
Arista EOS device. The list entries can either be the username
or a hash of username and properties. This argument is mutually
exclusive with the C(username) argument.
version_added: "2.4"
username:
description:
- The username to be configured on the remote Arista EOS
device. This argument accepts a stringv value and is mutually
exclusive with the C(users) argument.
exclusive with the C(aggregate) argument.
Please note that this option is not same as C(provider username).
password:
description:
@@ -115,7 +116,7 @@ EXAMPLES = """
- name: set multiple users to privilege level 15
eos_user:
users:
aggregate:
- username: netop
- username: netend
privilege: 15
@@ -263,8 +264,8 @@ def get_param_value(key, item, module):
return value
def map_params_to_obj(module):
users = module.params['users']
if not users:
aggregate = module.params['aggregate']
if not aggregate:
if not module.params['username'] and module.params['purge']:
return list()
elif not module.params['username']:
@@ -273,7 +274,7 @@ def map_params_to_obj(module):
collection = [{'username': module.params['username']}]
else:
collection = list()
for item in users:
for item in aggregate:
if not isinstance(item, dict):
collection.append({'username': item})
elif all(u not in item for u in ['username', 'name']):
@@ -315,7 +316,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']),
username=dict(aliases=['name']),
password=dict(no_log=True),
@@ -332,7 +333,7 @@ def main():
)
argument_spec.update(eos_argument_spec)
mutually_exclusive = [('username', 'users')]
mutually_exclusive = [('username', 'aggregate')]
module = AnsibleModule(argument_spec=argument_spec,
mutually_exclusive=mutually_exclusive,

View File

@@ -45,11 +45,11 @@ options:
description:
- List of interfaces to check the VLAN has been
configured correctly.
collection:
aggregate:
description: List of VLANs definitions
purge:
description:
- Purge VLANs not defined in the collections parameter.
- Purge VLANs not defined in the aggregates parameter.
default: no
state:
description:
@@ -157,7 +157,7 @@ def main():
vlan_id=dict(required=True, type='int'),
name=dict(),
interfaces=dict(),
collection=dict(),
aggregate=dict(),
purge=dict(default=False, type='bool'),
state=dict(default='present',
choices=['present', 'absent', 'active', 'suspend'])

View File

@@ -45,11 +45,11 @@ options:
description:
- List of interfaces to check the VRF has been
configured correctly.
collection:
aggregate:
description: List of VRFs definitions
purge:
description:
- Purge VRFs not defined in the collections parameter.
- Purge VRFs not defined in the aggregates parameter.
default: no
state:
description:
@@ -154,7 +154,7 @@ def main():
name=dict(required=True),
interfaces=dict(type='list'),
rd=dict(),
collection=dict(),
aggregate=dict(),
purge=dict(default=False, type='bool'),
state=dict(default='present', choices=['present', 'absent'])
)