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
commit 8643e9cb34
42 changed files with 170 additions and 167 deletions

View file

@ -61,11 +61,11 @@ options:
rx_rate:
description:
- Receiver rate.
collection:
aggregate:
description: List of Interfaces definitions.
purge:
description:
- Purge Interfaces not defined in the collections parameter.
- Purge Interfaces not defined in the aggregates parameter.
This applies only for logical interface.
default: no
state:
@ -179,7 +179,7 @@ def main():
duplex=dict(choices=['full', 'half', 'auto']),
tx_rate=dict(),
rx_rate=dict(),
collection=dict(),
aggregate=dict(),
purge=dict(default=False, type='bool'),
state=dict(default='present',
choices=['present', 'absent', 'up', 'down']),

View file

@ -49,11 +49,11 @@ options:
level:
description:
- Set logging severity levels.
collection:
aggregate:
description: List of logging definitions.
purge:
description:
- Purge logging not defined in the collections parameter.
- Purge logging not defined in the aggregates parameter.
default: no
state:
description:
@ -173,7 +173,7 @@ def main():
size=dict(type='int'),
files=dict(type='int'),
src_addr=dict(),
collection=dict(),
aggregate=dict(),
purge=dict(default=False, type='bool'),
state=dict(default='present', choices=['present', 'absent']),
active=dict(default=True, type='bool')

View file

@ -54,11 +54,11 @@ options:
qualified_preference:
description:
- Assign preference for qualified next hop.
collection:
aggregate:
description: List of static route definitions
purge:
description:
- Purge static routes not defined in the collections parameter.
- Purge static routes not defined in the aggregates parameter.
default: no
state:
description:
@ -161,15 +161,15 @@ def main():
preference=dict(type='int', aliases=['admin_distance']),
qualified_next_hop=dict(type='str'),
qualified_preference=dict(type='int'),
collection=dict(type='list'),
aggregate=dict(type='list'),
purge=dict(type='bool'),
state=dict(default='present', choices=['present', 'absent']),
active=dict(default=True, type='bool')
)
argument_spec.update(junos_argument_spec)
required_one_of = [['collection', 'address']]
mutually_exclusive = [['collection', 'address']]
required_one_of = [['aggregate', 'address']]
mutually_exclusive = [['aggregate', 'address']]
module = AnsibleModule(argument_spec=argument_spec,
required_one_of=required_one_of,

View file

@ -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)

View file

@ -49,11 +49,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:
@ -144,7 +144,7 @@ def main():
vlan_id=dict(required=True, type='int'),
description=dict(),
interfaces=dict(),
collection=dict(),
aggregate=dict(),
purge=dict(default=False, type='bool'),
state=dict(default='present', choices=['present', 'absent']),
active=dict(default=True, type='bool')