From b7d886840beaaba093c011a042cef5ad523ef206 Mon Sep 17 00:00:00 2001 From: David Newswanger Date: Wed, 16 Aug 2017 00:01:25 -0400 Subject: [PATCH] standardized agreggate as arg, and collection and users as aliases for user modules (#28244) --- lib/ansible/modules/network/eos/eos_user.py | 2 +- lib/ansible/modules/network/ios/ios_user.py | 12 ++++++------ lib/ansible/modules/network/iosxr/iosxr_user.py | 12 ++++++------ lib/ansible/modules/network/junos/junos_user.py | 2 +- lib/ansible/modules/network/nxos/nxos_user.py | 2 +- lib/ansible/modules/network/vyos/vyos_user.py | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_user.py b/lib/ansible/modules/network/eos/eos_user.py index 1ff5d180b94..72294afdb84 100644 --- a/lib/ansible/modules/network/eos/eos_user.py +++ b/lib/ansible/modules/network/eos/eos_user.py @@ -40,7 +40,7 @@ options: - 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. + exclusive with the C(username) argument. alias C(users). version_added: "2.4" username: description: diff --git a/lib/ansible/modules/network/ios/ios_user.py b/lib/ansible/modules/network/ios/ios_user.py index 5b354a2f180..fb968b754ac 100644 --- a/lib/ansible/modules/network/ios/ios_user.py +++ b/lib/ansible/modules/network/ios/ios_user.py @@ -36,12 +36,12 @@ description: current running config. It also supports purging usernames from the configuration that are not explicitly defined. options: - users: + aggregate: description: - The set of username objects to be configured on the remote Cisco IOS device. The list entries can either be the username 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: description: - The username to be configured on the Cisco IOS device. @@ -110,7 +110,7 @@ EXAMPLES = """ purge: yes - name: set multiple users to privilege level 15 ios_user: - users: + aggregate: - name: netop - name: netend privilege: 15 @@ -249,7 +249,7 @@ def get_param_value(key, item, module): def map_params_to_obj(module): - users = module.params['users'] + users = module.params['aggregate'] if not users: if not module.params['name'] and module.params['purge']: return list() @@ -298,7 +298,7 @@ def main(): """ main entry point for module execution """ argument_spec = dict( - users=dict(type='list', aliases=['aggregate']), + aggregate=dict(type='list', aliases=['users', 'collection']), name=dict(), password=dict(no_log=True), @@ -313,7 +313,7 @@ def main(): ) argument_spec.update(ios_argument_spec) - mutually_exclusive = [('name', 'users')] + mutually_exclusive = [('name', 'aggregate')] module = AnsibleModule(argument_spec=argument_spec, mutually_exclusive=mutually_exclusive, diff --git a/lib/ansible/modules/network/iosxr/iosxr_user.py b/lib/ansible/modules/network/iosxr/iosxr_user.py index 3cb71f1a6c0..dfcb45c9a8c 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_user.py +++ b/lib/ansible/modules/network/iosxr/iosxr_user.py @@ -25,12 +25,12 @@ description: current running config. It also supports purging usernames from the configuration that are not explicitly defined. options: - users: + aggregate: description: - The set of username objects to be configured on the remote Cisco IOS XR device. The list entries can either be the username 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: description: - The username to be configured on the Cisco IOS XR device. @@ -88,7 +88,7 @@ EXAMPLES = """ purge: yes - name: set multiple users to group sys-admin iosxr_user: - users: + aggregate: - name: netop - name: netend group: sysadmin @@ -210,7 +210,7 @@ def get_param_value(key, item, module): def map_params_to_obj(module): - users = module.params['users'] + users = module.params['aggregate'] if not users: if not module.params['name'] and module.params['purge']: return list() @@ -244,7 +244,7 @@ def main(): """ main entry point for module execution """ argument_spec = dict( - users=dict(type='list', aliases=['aggregate']), + aggregate=dict(type='list', aliases=['users', 'collection']), name=dict(), password=dict(no_log=True), @@ -257,7 +257,7 @@ def main(): ) argument_spec.update(iosxr_argument_spec) - mutually_exclusive = [('name', 'users')] + mutually_exclusive = [('name', 'aggregate')] module = AnsibleModule(argument_spec=argument_spec, mutually_exclusive=mutually_exclusive, diff --git a/lib/ansible/modules/network/junos/junos_user.py b/lib/ansible/modules/network/junos/junos_user.py index 5e7e6b73047..c66b9592602 100644 --- a/lib/ansible/modules/network/junos/junos_user.py +++ b/lib/ansible/modules/network/junos/junos_user.py @@ -32,7 +32,7 @@ options: 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. + the name argument. alias C(users). version_added: "2.4" required: False default: null diff --git a/lib/ansible/modules/network/nxos/nxos_user.py b/lib/ansible/modules/network/nxos/nxos_user.py index 208fc8fcccf..1cb18cfa5d5 100644 --- a/lib/ansible/modules/network/nxos/nxos_user.py +++ b/lib/ansible/modules/network/nxos/nxos_user.py @@ -40,7 +40,7 @@ options: - The set of username objects to be configured on the remote Cisco Nexus device. The list entries can either be the username 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" required: false default: null diff --git a/lib/ansible/modules/network/vyos/vyos_user.py b/lib/ansible/modules/network/vyos/vyos_user.py index 1de6e254956..38c7902e8ae 100644 --- a/lib/ansible/modules/network/vyos/vyos_user.py +++ b/lib/ansible/modules/network/vyos/vyos_user.py @@ -36,12 +36,12 @@ description: current running config. It also supports purging usernames from the configuration that are not explicitly defined. options: - users: + aggregate: description: - The set of username objects to be configured on the remote VyOS device. The list entries can either be the username 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: description: - The username to be configured on the VyOS device. @@ -102,7 +102,7 @@ EXAMPLES = """ purge: yes - name: set multiple users to level operator vyos_user: - users: + aggregate: - name: netop - name: netend level: operator @@ -289,7 +289,7 @@ def main(): remove_default_spec(aggregate_spec) 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)