standardized agreggate as arg, and collection and users as aliases for user modules (#28244)

This commit is contained in:
David Newswanger 2017-08-16 00:01:25 -04:00 committed by Ganesh Nalawade
parent edba563e9a
commit b7d886840b
6 changed files with 19 additions and 19 deletions

View file

@ -40,7 +40,7 @@ options:
- The set of username objects to be configured on the remote - The set of username objects to be configured on the remote
Arista EOS device. The list entries can either be the username Arista EOS device. The list entries can either be the username
or a hash of username and properties. This argument is mutually or a hash of username and properties. This argument is mutually
exclusive with the C(username) argument. exclusive with the C(username) argument. alias C(users).
version_added: "2.4" version_added: "2.4"
username: username:
description: description:

View file

@ -36,12 +36,12 @@ description:
current running config. It also supports purging usernames from the current running config. It also supports purging usernames from the
configuration that are not explicitly defined. configuration that are not explicitly defined.
options: options:
users: aggregate:
description: description:
- The set of username objects to be configured on the remote - The set of username objects to be configured on the remote
Cisco IOS device. The list entries can either be the username Cisco IOS device. The list entries can either be the username
or a hash of username and properties. This argument is mutually or a hash of username and properties. This argument is mutually
exclusive with the C(name) argument. exclusive with the C(name) argument. alias C(users).
name: name:
description: description:
- The username to be configured on the Cisco IOS device. - The username to be configured on the Cisco IOS device.
@ -110,7 +110,7 @@ EXAMPLES = """
purge: yes purge: yes
- name: set multiple users to privilege level 15 - name: set multiple users to privilege level 15
ios_user: ios_user:
users: aggregate:
- name: netop - name: netop
- name: netend - name: netend
privilege: 15 privilege: 15
@ -249,7 +249,7 @@ def get_param_value(key, item, module):
def map_params_to_obj(module): def map_params_to_obj(module):
users = module.params['users'] users = module.params['aggregate']
if not users: if not users:
if not module.params['name'] and module.params['purge']: if not module.params['name'] and module.params['purge']:
return list() return list()
@ -298,7 +298,7 @@ def main():
""" main entry point for module execution """ main entry point for module execution
""" """
argument_spec = dict( argument_spec = dict(
users=dict(type='list', aliases=['aggregate']), aggregate=dict(type='list', aliases=['users', 'collection']),
name=dict(), name=dict(),
password=dict(no_log=True), password=dict(no_log=True),
@ -313,7 +313,7 @@ def main():
) )
argument_spec.update(ios_argument_spec) argument_spec.update(ios_argument_spec)
mutually_exclusive = [('name', 'users')] mutually_exclusive = [('name', 'aggregate')]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
mutually_exclusive=mutually_exclusive, mutually_exclusive=mutually_exclusive,

View file

@ -25,12 +25,12 @@ description:
current running config. It also supports purging usernames from the current running config. It also supports purging usernames from the
configuration that are not explicitly defined. configuration that are not explicitly defined.
options: options:
users: aggregate:
description: description:
- The set of username objects to be configured on the remote - The set of username objects to be configured on the remote
Cisco IOS XR device. The list entries can either be the username Cisco IOS XR device. The list entries can either be the username
or a hash of username and properties. This argument is mutually or a hash of username and properties. This argument is mutually
exclusive with the C(name) argument, alias C(aggregate). exclusive with the C(name) argument, alias C(users).
name: name:
description: description:
- The username to be configured on the Cisco IOS XR device. - The username to be configured on the Cisco IOS XR device.
@ -88,7 +88,7 @@ EXAMPLES = """
purge: yes purge: yes
- name: set multiple users to group sys-admin - name: set multiple users to group sys-admin
iosxr_user: iosxr_user:
users: aggregate:
- name: netop - name: netop
- name: netend - name: netend
group: sysadmin group: sysadmin
@ -210,7 +210,7 @@ def get_param_value(key, item, module):
def map_params_to_obj(module): def map_params_to_obj(module):
users = module.params['users'] users = module.params['aggregate']
if not users: if not users:
if not module.params['name'] and module.params['purge']: if not module.params['name'] and module.params['purge']:
return list() return list()
@ -244,7 +244,7 @@ def main():
""" main entry point for module execution """ main entry point for module execution
""" """
argument_spec = dict( argument_spec = dict(
users=dict(type='list', aliases=['aggregate']), aggregate=dict(type='list', aliases=['users', 'collection']),
name=dict(), name=dict(),
password=dict(no_log=True), password=dict(no_log=True),
@ -257,7 +257,7 @@ def main():
) )
argument_spec.update(iosxr_argument_spec) argument_spec.update(iosxr_argument_spec)
mutually_exclusive = [('name', 'users')] mutually_exclusive = [('name', 'aggregate')]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
mutually_exclusive=mutually_exclusive, mutually_exclusive=mutually_exclusive,

View file

@ -32,7 +32,7 @@ options:
on the remote device. The list of users will be compared against 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 current users and only changes will be added or removed from
the device configuration. This argument is mutually exclusive with the device configuration. This argument is mutually exclusive with
the name argument. the name argument. alias C(users).
version_added: "2.4" version_added: "2.4"
required: False required: False
default: null default: null

View file

@ -40,7 +40,7 @@ options:
- The set of username objects to be configured on the remote - The set of username objects to be configured on the remote
Cisco Nexus device. The list entries can either be the username Cisco Nexus device. The list entries can either be the username
or a hash of username and properties. This argument is mutually or a hash of username and properties. This argument is mutually
exclusive with the C(name) argument. exclusive with the C(name) argument. alias C(users).
version_added: "2.4" version_added: "2.4"
required: false required: false
default: null default: null

View file

@ -36,12 +36,12 @@ description:
current running config. It also supports purging usernames from the current running config. It also supports purging usernames from the
configuration that are not explicitly defined. configuration that are not explicitly defined.
options: options:
users: aggregate:
description: description:
- The set of username objects to be configured on the remote - The set of username objects to be configured on the remote
VyOS device. The list entries can either be the username or VyOS device. The list entries can either be the username or
a hash of username and properties. This argument is mutually a hash of username and properties. This argument is mutually
exclusive with the C(name) argument. alias C(aggregate). exclusive with the C(name) argument. alias C(users).
name: name:
description: description:
- The username to be configured on the VyOS device. - The username to be configured on the VyOS device.
@ -102,7 +102,7 @@ EXAMPLES = """
purge: yes purge: yes
- name: set multiple users to level operator - name: set multiple users to level operator
vyos_user: vyos_user:
users: aggregate:
- name: netop - name: netop
- name: netend - name: netend
level: operator level: operator
@ -289,7 +289,7 @@ def main():
remove_default_spec(aggregate_spec) remove_default_spec(aggregate_spec)
argument_spec = dict( argument_spec = dict(
aggregate=dict(type='list', elements='dict', options=aggregate_spec, aliases=['users']), aggregate=dict(type='list', elements='dict', options=aggregate_spec, aliases=['users', 'collection']),
) )
argument_spec.update(element_spec) argument_spec.update(element_spec)