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
pull/27324/head
David Newswanger 7 years ago committed by Peter Sprygada
parent 9d771f6eea
commit 8643e9cb34

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

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

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

@ -64,11 +64,11 @@ options:
rx_rate: rx_rate:
description: description:
- Receiver rate - Receiver rate
collection: aggregate:
description: List of Interfaces definitions. description: List of Interfaces definitions.
purge: purge:
description: description:
- Purge Interfaces not defined in the collections parameter. - Purge Interfaces not defined in the aggregates parameter.
This applies only for logical interface. This applies only for logical interface.
default: no default: no
state: state:

@ -55,11 +55,11 @@ options:
description: description:
- Minimum members that should be up - Minimum members that should be up
before bringing up the link aggregation group. before bringing up the link aggregation group.
collection: aggregate:
description: List of link aggregation definitions. description: List of link aggregation definitions.
purge: purge:
description: description:
- Purge link aggregation groups not defined in the collections parameter. - Purge link aggregation groups not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:

@ -47,11 +47,11 @@ options:
description: description:
- Admin distance of the static route. - Admin distance of the static route.
default: 1 default: 1
collection: aggregate:
description: List of static route definitions description: List of static route definitions
purge: purge:
description: description:
- Purge static routes not defined in the collections parameter. - Purge static routes not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:
@ -74,9 +74,9 @@ EXAMPLES = """
next_hop: 10.0.0.1 next_hop: 10.0.0.1
state: absent state: absent
- name: configure collections of static routes - name: configure aggregates of static routes
ios_static_route: ios_static_route:
collection: aggregate:
- { prefix: 192.168.2.0, mask 255.255.255.0, next_hop: 10.0.0.1 } - { prefix: 192.168.2.0, mask 255.255.255.0, next_hop: 10.0.0.1 }
- { prefix: 192.168.3.0, mask 255.255.255.0, next_hop: 10.0.2.1 } - { prefix: 192.168.3.0, mask 255.255.255.0, next_hop: 10.0.2.1 }
""" """
@ -146,8 +146,8 @@ def map_config_to_obj(module):
def map_params_to_obj(module): def map_params_to_obj(module):
obj = [] obj = []
if 'collection' in module.params and module.params['collection']: if 'aggregate' in module.params and module.params['aggregate']:
for c in module.params['collection']: for c in module.params['aggregate']:
d = c.copy() d = c.copy()
if 'state' not in d: if 'state' not in d:
@ -182,15 +182,15 @@ def main():
mask=dict(type='str'), mask=dict(type='str'),
next_hop=dict(type='str'), next_hop=dict(type='str'),
admin_distance=dict(default=1, type='int'), admin_distance=dict(default=1, type='int'),
collection=dict(type='list'), aggregate=dict(type='list'),
purge=dict(type='bool'), purge=dict(type='bool'),
state=dict(default='present', choices=['present', 'absent']) state=dict(default='present', choices=['present', 'absent'])
) )
argument_spec.update(ios_argument_spec) argument_spec.update(ios_argument_spec)
required_one_of = [['collection', 'prefix']] required_one_of = [['aggregate', 'prefix']]
required_together = [['prefix', 'mask', 'next_hop']] required_together = [['prefix', 'mask', 'next_hop']]
mutually_exclusive = [['collection', 'prefix']] mutually_exclusive = [['aggregate', 'prefix']]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
required_one_of=required_one_of, required_one_of=required_one_of,

@ -28,11 +28,11 @@ DOCUMENTATION = """
module: ios_user module: ios_user
version_added: "2.4" version_added: "2.4"
author: "Trishna Guha (@trishnag)" author: "Trishna Guha (@trishnag)"
short_description: Manage the collection of local users on Cisco IOS device short_description: Manage the aggregate of local users on Cisco IOS device
description: description:
- This module provides declarative management of the local usernames - This module provides declarative management of the local usernames
configured on network devices. It allows playbooks to manage configured on network devices. It allows playbooks to manage
either individual usernames or the collection of usernames in the either individual usernames or the aggregate of usernames in the
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:
@ -46,7 +46,7 @@ options:
description: description:
- The username to be configured on the Cisco IOS device. - The username to be configured on the Cisco IOS device.
This argument accepts a string value and is mutually exclusive This argument accepts a string value and is mutually exclusive
with the C(collection) argument. with the C(aggregate) argument.
Please note that this option is not same as C(provider username). Please note that this option is not same as C(provider username).
password: password:
description: description:
@ -256,20 +256,20 @@ def map_params_to_obj(module):
elif not module.params['name']: elif not module.params['name']:
module.fail_json(msg='username is required') module.fail_json(msg='username is required')
else: else:
collection = [{'name': module.params['name']}] aggregate = [{'name': module.params['name']}]
else: else:
collection = list() aggregate = list()
for item in users: for item in users:
if not isinstance(item, dict): if not isinstance(item, dict):
collection.append({'name': item}) aggregate.append({'name': item})
elif 'name' not in item: elif 'name' not in item:
module.fail_json(msg='name is required') module.fail_json(msg='name is required')
else: else:
collection.append(item) aggregate.append(item)
objects = list() objects = list()
for item in collection: for item in aggregate:
get_value = partial(get_param_value, item=item, module=module) get_value = partial(get_param_value, item=item, module=module)
item['password'] = get_value('password') item['password'] = get_value('password')
item['nopassword'] = get_value('nopassword') item['nopassword'] = get_value('nopassword')
@ -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=['collection']), users=dict(type='list', aliases=['aggregate']),
name=dict(), name=dict(),
password=dict(no_log=True), password=dict(no_log=True),

@ -28,11 +28,11 @@ DOCUMENTATION = """
module: iosxr_user module: iosxr_user
version_added: "2.4" version_added: "2.4"
author: "Trishna Guha (@trishnag)" author: "Trishna Guha (@trishnag)"
short_description: Manage the collection of local users on Cisco IOS XR device short_description: Manage the aggregate of local users on Cisco IOS XR device
description: description:
- This module provides declarative management of the local usernames - This module provides declarative management of the local usernames
configured on network devices. It allows playbooks to manage configured on network devices. It allows playbooks to manage
either individual usernames or the collection of usernames in the either individual usernames or the aggregate of usernames in the
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:
@ -41,12 +41,12 @@ options:
- 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(collection). exclusive with the C(name) argument, alias C(aggregate).
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.
This argument accepts a string value and is mutually exclusive This argument accepts a string value and is mutually exclusive
with the C(collection) argument. with the C(aggregate) argument.
Please note that this option is not same as C(provider username). Please note that this option is not same as C(provider username).
password: password:
description: description:
@ -231,20 +231,20 @@ def map_params_to_obj(module):
elif not module.params['name']: elif not module.params['name']:
module.fail_json(msg='username is required') module.fail_json(msg='username is required')
else: else:
collection = [{'name': module.params['name']}] aggregate = [{'name': module.params['name']}]
else: else:
collection = list() aggregate = list()
for item in users: for item in users:
if not isinstance(item, dict): if not isinstance(item, dict):
collection.append({'name': item}) aggregate.append({'name': item})
elif 'name' not in item: elif 'name' not in item:
module.fail_json(msg='name is required') module.fail_json(msg='name is required')
else: else:
collection.append(item) aggregate.append(item)
objects = list() objects = list()
for item in collection: for item in aggregate:
get_value = partial(get_param_value, item=item, module=module) get_value = partial(get_param_value, item=item, module=module)
item['password'] = get_value('password') item['password'] = get_value('password')
item['group'] = get_value('group') item['group'] = get_value('group')
@ -258,7 +258,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=['collection']), users=dict(type='list', aliases=['aggregate']),
name=dict(), name=dict(),
password=dict(no_log=True), password=dict(no_log=True),

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

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

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

@ -34,13 +34,14 @@ description:
defined accounts defined accounts
extends_documentation_fragment: junos extends_documentation_fragment: junos
options: options:
users: aggregate:
description: 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 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.
version_added: "2.4"
required: False required: False
default: null default: null
name: name:
@ -48,7 +49,7 @@ options:
- The C(name) argument defines the username of the user to be created - The C(name) argument defines the username of the user to be created
on the system. This argument must follow appropriate usernaming on the system. This argument must follow appropriate usernaming
conventions for the target device running JUNOS. This argument is 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 required: false
default: null default: null
full_name: full_name:
@ -206,8 +207,8 @@ def get_param_value(key, item, module):
def map_params_to_obj(module): def map_params_to_obj(module):
users = module.params['users'] aggregate = module.params['aggregate']
if not users: if not aggregate:
if not module.params['name'] and module.params['purge']: if not module.params['name'] and module.params['purge']:
return list() return list()
elif not module.params['name']: elif not module.params['name']:
@ -216,7 +217,7 @@ def map_params_to_obj(module):
collection = [{'name': module.params['name']}] collection = [{'name': module.params['name']}]
else: else:
collection = list() collection = list()
for item in users: for item in aggregate:
if not isinstance(item, dict): if not isinstance(item, dict):
collection.append({'username': item}) collection.append({'username': item})
elif 'name' not in item: elif 'name' not in item:
@ -251,7 +252,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=['collection']), aggregate=dict(type='list', aliases=['collection', 'users']),
name=dict(), name=dict(),
full_name=dict(), full_name=dict(),
@ -264,7 +265,7 @@ def main():
active=dict(default=True, type='bool') active=dict(default=True, type='bool')
) )
mutually_exclusive = [('users', 'name')] mutually_exclusive = [('aggregate', 'name')]
argument_spec.update(junos_argument_spec) argument_spec.update(junos_argument_spec)

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

@ -36,7 +36,7 @@ options:
name: name:
description: description:
- Name of the interface excluding any logical unit number. - Name of the interface excluding any logical unit number.
collection: aggregate:
description: description:
- List of Layer-2 interface definitions. - List of Layer-2 interface definitions.
mode: mode:

@ -43,11 +43,11 @@ options:
interfaces: interfaces:
description: description:
- List of interfaces the VLAN should be configured on. - List of interfaces the VLAN should be configured on.
collection: aggregate:
description: List of VLANs definitions. description: List of VLANs definitions.
purge: purge:
description: description:
- Purge VLANs not defined in the collections parameter. - Purge VLANs not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:

@ -43,11 +43,11 @@ options:
ipv6: ipv6:
description: description:
- IPv6 of the L3 interface. - IPv6 of the L3 interface.
collection: aggregate:
description: List of L3 interfaces definitions description: List of L3 interfaces definitions
purge: purge:
description: description:
- Purge L3 interfaces not defined in the collections parameter. - Purge L3 interfaces not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:

@ -40,11 +40,11 @@ options:
interfaces: interfaces:
description: description:
- List of interfaces the VRF should be configured on. - List of interfaces the VRF should be configured on.
collection: aggregate:
description: List of VRFs definitions description: List of VRFs definitions
purge: purge:
description: description:
- Purge VRFs not defined in the collections parameter. - Purge VRFs not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:

@ -35,19 +35,20 @@ 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 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.
version_added: "2.4"
required: false required: false
default: null default: null
name: name:
description: description:
- The username to be configured on the remote Cisco Nexus - The username to be configured on the remote Cisco Nexus
device. This argument accepts a stringv value and is mutually device. This argument accepts a stringv value and is mutually
exclusive with the C(users) argument. exclusive with the C(aggregate) argument.
required: false required: false
default: null default: null
update_password: update_password:
@ -106,7 +107,7 @@ EXAMPLES = """
purge: yes purge: yes
- name: set multiple users role - name: set multiple users role
users: aggregate:
- name: netop - name: netop
- name: netend - name: netend
role: network-operator role: network-operator
@ -242,8 +243,8 @@ def get_param_value(key, item, module):
return value return value
def map_params_to_obj(module): def map_params_to_obj(module):
users = module.params['users'] aggregate = module.params['aggregate']
if not users: if not aggregate:
if not module.params['name'] and module.params['purge']: if not module.params['name'] and module.params['purge']:
return list() return list()
elif not module.params['name']: elif not module.params['name']:
@ -252,7 +253,7 @@ def map_params_to_obj(module):
collection = [{'name': module.params['name']}] collection = [{'name': module.params['name']}]
else: else:
collection = list() collection = list()
for item in users: for item in aggregate:
if not isinstance(item, dict): if not isinstance(item, dict):
collection.append({'name': item}) collection.append({'name': item})
elif 'name' not in item: elif 'name' not in item:
@ -298,7 +299,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', no_log=True, aliases=['collection']), aggregate=dict(type='list', no_log=True, aliases=['collection', 'users']),
name=dict(), name=dict(),
password=dict(no_log=True), password=dict(no_log=True),
@ -314,7 +315,7 @@ def main():
argument_spec.update(nxos_argument_spec) argument_spec.update(nxos_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,

@ -49,11 +49,11 @@ options:
admin_distance: admin_distance:
description: description:
- Admin distance of the static route. - Admin distance of the static route.
collection: aggregate:
description: List of static route definitions description: List of static route definitions
purge: purge:
description: description:
- Purge static routes not defined in the collections parameter. - Purge static routes not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:
@ -76,9 +76,9 @@ EXAMPLES = """
next_hop: 10.0.0.1 next_hop: 10.0.0.1
state: absent state: absent
- name: configure collections of static routes - name: configure aggregates of static routes
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 192.168.2.0, mask 255.255.255.0, next_hop: 10.0.0.1 } - { prefix: 192.168.2.0, mask 255.255.255.0, next_hop: 10.0.0.1 }
- { prefix: 192.168.3.0, mask 255.255.255.0, next_hop: 10.0.2.1 } - { prefix: 192.168.3.0, mask 255.255.255.0, next_hop: 10.0.2.1 }
""" """

@ -48,11 +48,11 @@ options:
level: level:
description: description:
- Set logging severity levels. - Set logging severity levels.
collection: aggregate:
description: List of logging definitions. description: List of logging definitions.
purge: purge:
description: description:
- Purge logging not defined in the collections parameter. - Purge logging not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:

@ -28,15 +28,15 @@ DOCUMENTATION = """
module: net_user module: net_user
version_added: "2.4" version_added: "2.4"
author: "Trishna Guha (@trishnag)" author: "Trishna Guha (@trishnag)"
short_description: Manage the collection of local users on network device short_description: Manage the aggregate of local users on network device
description: description:
- This module provides declarative management of the local usernames - This module provides declarative management of the local usernames
configured on network devices. It allows playbooks to manage configured on network devices. It allows playbooks to manage
either individual usernames or the collection of usernames in the either individual usernames or the aggregate of usernames in the
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:
collection: 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
network device. The list entries can either be the username network device. The list entries can either be the username
@ -46,7 +46,7 @@ options:
description: description:
- The username to be configured on the remote network device. - The username to be configured on the remote network device.
This argument accepts a string value and is mutually exclusive This argument accepts a string value and is mutually exclusive
with the C(collection) argument. with the C(aggregate) argument.
Please note that this option is not same as C(provider username). Please note that this option is not same as C(provider username).
password: password:
description: description:
@ -114,7 +114,7 @@ EXAMPLES = """
purge: yes purge: yes
- name: set multiple users to privilege level 15 - name: set multiple users to privilege level 15
net_user: net_user:
collection: aggregate:
- name: netop - name: netop
- name: netend - name: netend
privilege: 15 privilege: 15

@ -47,11 +47,11 @@ options:
members: members:
description: description:
- List of members of the link aggregation group. - List of members of the link aggregation group.
collection: aggregate:
description: List of link aggregation definitions. description: List of link aggregation definitions.
purge: purge:
description: description:
- Purge link aggregation groups not defined in the collections parameter. - Purge link aggregation groups not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:
@ -174,8 +174,8 @@ def map_config_to_obj(module):
def map_params_to_obj(module): def map_params_to_obj(module):
obj = [] obj = []
if 'collection' in module.params and module.params['collection']: if 'aggregate' in module.params and module.params['aggregate']:
for c in module.params['collection']: for c in module.params['aggregate']:
d = c.copy() d = c.copy()
if 'state' not in d: if 'state' not in d:
@ -205,7 +205,7 @@ def main():
'adaptive-load-balance', 'xor-hash', 'on'], 'adaptive-load-balance', 'xor-hash', 'on'],
default='802.3ad'), default='802.3ad'),
members=dict(type='list'), members=dict(type='list'),
collection=dict(type='list'), aggregate=dict(type='list'),
purge=dict(default=False, type='bool'), purge=dict(default=False, type='bool'),
state=dict(default='present', state=dict(default='present',
choices=['present', 'absent', 'up', 'down']) choices=['present', 'absent', 'up', 'down'])
@ -213,8 +213,8 @@ def main():
argument_spec.update(vyos_argument_spec) argument_spec.update(vyos_argument_spec)
required_one_of = [['name', 'collection']] required_one_of = [['name', 'aggregate']]
mutually_exclusive = [['name', 'collection']] mutually_exclusive = [['name', 'aggregate']]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
required_one_of=required_one_of, required_one_of=required_one_of,
supports_check_mode=True) supports_check_mode=True)

@ -48,11 +48,11 @@ options:
admin_distance: admin_distance:
description: description:
- Admin distance of the static route. - Admin distance of the static route.
collection: aggregate:
description: List of static route definitions description: List of static route definitions
purge: purge:
description: description:
- Purge static routes not defined in the collections parameter. - Purge static routes not defined in the aggregates parameter.
default: no default: no
state: state:
description: description:
@ -77,9 +77,9 @@ EXAMPLES = """
mask: 16 mask: 16
next_hop: 10.0.0.1 next_hop: 10.0.0.1
state: absent state: absent
- name: configure collections of static routes - name: configure aggregates of static routes
vyos_static_route: vyos_static_route:
collection: aggregate:
- { prefix: 192.168.2.0, mask: 24, next_hop: 10.0.0.1 } - { prefix: 192.168.2.0, mask: 24, next_hop: 10.0.0.1 }
- { prefix: 192.168.3.0, mask: 16, next_hop: 10.0.2.1 } - { prefix: 192.168.3.0, mask: 16, next_hop: 10.0.2.1 }
- { prefix: 192.168.3.0/16, next_hop: 10.0.2.1 } - { prefix: 192.168.3.0/16, next_hop: 10.0.2.1 }
@ -159,8 +159,8 @@ def config_to_dict(module):
def map_params_to_obj(module): def map_params_to_obj(module):
obj = [] obj = []
if 'collection' in module.params and module.params['collection']: if 'aggregate' in module.params and module.params['aggregate']:
for c in module.params['collection']: for c in module.params['aggregate']:
d = c.copy() d = c.copy()
if '/' in d['prefix']: if '/' in d['prefix']:
d['mask'] = d['prefix'].split('/')[1] d['mask'] = d['prefix'].split('/')[1]
@ -202,15 +202,15 @@ def main():
mask=dict(type='str'), mask=dict(type='str'),
next_hop=dict(type='str'), next_hop=dict(type='str'),
admin_distance=dict(type='int'), admin_distance=dict(type='int'),
collection=dict(type='list'), aggregate=dict(type='list'),
purge=dict(type='bool'), purge=dict(type='bool'),
state=dict(default='present', choices=['present', 'absent']) state=dict(default='present', choices=['present', 'absent'])
) )
argument_spec.update(vyos_argument_spec) argument_spec.update(vyos_argument_spec)
required_one_of = [['collection', 'prefix']] required_one_of = [['aggregate', 'prefix']]
required_together = [['prefix', 'next_hop']] required_together = [['prefix', 'next_hop']]
mutually_exclusive = [['collection', 'prefix']] mutually_exclusive = [['aggregate', 'prefix']]
module = AnsibleModule(argument_spec=argument_spec, module = AnsibleModule(argument_spec=argument_spec,
required_one_of=required_one_of, required_one_of=required_one_of,

@ -46,7 +46,7 @@ options:
description: description:
- The username to be configured on the VyOS device. - The username to be configured on the VyOS device.
This argument accepts a string value and is mutually exclusive This argument accepts a string value and is mutually exclusive
with the C(collection) argument. with the C(aggregate) argument.
Please note that this option is not same as C(provider username). Please note that this option is not same as C(provider username).
full_name: full_name:
description: description:
@ -238,20 +238,20 @@ def map_params_to_obj(module):
elif not module.params['name']: elif not module.params['name']:
module.fail_json(msg='username is required') module.fail_json(msg='username is required')
else: else:
collection = [{'name': module.params['name']}] aggregate = [{'name': module.params['name']}]
else: else:
collection = list() aggregate = list()
for item in users: for item in users:
if not isinstance(item, dict): if not isinstance(item, dict):
collection.append({'name': item}) aggregate.append({'name': item})
elif 'name' not in item: elif 'name' not in item:
module.fail_json(msg='name is required') module.fail_json(msg='name is required')
else: else:
collection.append(item) aggregate.append(item)
objects = list() objects = list()
for item in collection: for item in aggregate:
get_value = partial(get_param_value, item=item, module=module) get_value = partial(get_param_value, item=item, module=module)
item['password'] = get_value('password') item['password'] = get_value('password')
item['full_name'] = get_value('full_name') item['full_name'] = get_value('full_name')
@ -279,7 +279,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=['collection']), users=dict(type='list', aliases=['aggregate']),
name=dict(), name=dict(),
full_name=dict(), full_name=dict(),

@ -16,7 +16,7 @@
- name: Collection of users - name: Collection of users
eos_user: eos_user:
users: aggregate:
- username: test1 - username: test1
- username: test2 - username: test2
authorize: yes authorize: yes

@ -90,9 +90,9 @@
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Add static route collections - name: Add static route aggregates
ios_static_route: ios_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
state: present state: present
@ -105,9 +105,9 @@
- 'result.changed == true' - 'result.changed == true'
- 'result.commands == ["ip route 172.16.32.0 255.255.255.0 10.0.0.8 1", "ip route 172.16.33.0 255.255.255.0 10.0.0.8 1"]' - 'result.commands == ["ip route 172.16.32.0 255.255.255.0 10.0.0.8 1", "ip route 172.16.33.0 255.255.255.0 10.0.0.8 1"]'
- name: Add and remove static route collections with overrides - name: Add and remove static route aggregates with overrides
ios_static_route: ios_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8, state: absent } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8, state: absent }
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
@ -121,9 +121,9 @@
- 'result.changed == true' - 'result.changed == true'
- 'result.commands == ["no ip route 172.16.33.0 255.255.255.0 10.0.0.8", "ip route 172.16.34.0 255.255.255.0 10.0.0.8 1"]' - 'result.commands == ["no ip route 172.16.33.0 255.255.255.0 10.0.0.8", "ip route 172.16.34.0 255.255.255.0 10.0.0.8 1"]'
- name: Remove static route collections - name: Remove static route aggregates
ios_static_route: ios_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }

@ -16,7 +16,7 @@
- name: Collection of users (SetUp) - name: Collection of users (SetUp)
ios_user: ios_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
authorize: yes authorize: yes
@ -47,7 +47,7 @@
- name: Add collection of users again (Idempotent) - name: Add collection of users again (Idempotent)
ios_user: ios_user:
users: aggregate:
- name: anisbletest2 - name: anisbletest2
- name: ansibletest3 - name: ansibletest3
authorize: yes authorize: yes
@ -63,7 +63,7 @@
- name: tearDown - name: tearDown
ios_user: ios_user:
users: aggregate:
- name: ansibletest1 - name: ansibletest1
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3

@ -83,7 +83,7 @@
- name: Collection of users (SetUp) - name: Collection of users (SetUp)
iosxr_user: iosxr_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
password: test password: test
@ -104,7 +104,7 @@
- name: Add collection of users again with update_password always (not idempotent) - name: Add collection of users again with update_password always (not idempotent)
iosxr_user: iosxr_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
password: test password: test
@ -123,7 +123,7 @@
- name: Add collection of users again with update_password on_create (idempotent) - name: Add collection of users again with update_password on_create (idempotent)
iosxr_user: iosxr_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
password: test password: test
@ -140,7 +140,7 @@
- name: Delete collection of users - name: Delete collection of users
iosxr_user: iosxr_user:
users: aggregate:
- name: ansibletest1 - name: ansibletest1
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
@ -155,7 +155,7 @@
- name: Delete collection of users again (idempotent) - name: Delete collection of users again (idempotent)
iosxr_user: iosxr_user:
users: aggregate:
- name: ansibletest1 - name: ansibletest1
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3

@ -123,7 +123,7 @@
- name: Teardown list of users - name: Teardown list of users
junos_user: junos_user:
collection: aggregate:
- {name: test_user1, state: absent} - {name: test_user1, state: absent}
- {name: test_user2, state: absent} - {name: test_user2, state: absent}
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -131,7 +131,7 @@
- name: Create list of users - name: Create list of users
junos_user: junos_user:
collection: aggregate:
- {name: test_user1, full_name: test_user2, role: operator, state: present} - {name: test_user1, full_name: test_user2, role: operator, state: present}
- {name: test_user2, full_name: test_user2, role: read-only, state: present} - {name: test_user2, full_name: test_user2, role: read-only, state: present}
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -151,7 +151,7 @@
- name: Delete list of users - name: Delete list of users
junos_user: junos_user:
collection: aggregate:
- {name: test_user1, full_name: test_user2, role: operator, state: absent} - {name: test_user1, full_name: test_user2, role: operator, state: absent}
- {name: test_user2, full_name: test_user2, role: read-only, state: absent} - {name: test_user2, full_name: test_user2, role: read-only, state: absent}
provider: "{{ netconf }}" provider: "{{ netconf }}"

@ -126,7 +126,7 @@
- name: Create collection of linkagg definitions - name: Create collection of linkagg definitions
net_linkagg: net_linkagg:
collection: aggregate:
- { name: bond0, members: [eth1, eth2] } - { name: bond0, members: [eth1, eth2] }
- { name: bond1, members: [eth3, eth4] } - { name: bond1, members: [eth3, eth4] }
state: present state: present
@ -144,7 +144,7 @@
- name: Create collection of linkagg definitions again (idempotent) - name: Create collection of linkagg definitions again (idempotent)
net_linkagg: net_linkagg:
collection: aggregate:
- { name: bond0, members: [eth1, eth2] } - { name: bond0, members: [eth1, eth2] }
- { name: bond1, members: [eth3, eth4] } - { name: bond1, members: [eth3, eth4] }
state: present state: present
@ -156,7 +156,7 @@
- name: Remove collection of linkagg definitions - name: Remove collection of linkagg definitions
net_linkagg: net_linkagg:
collection: aggregate:
- { name: bond0 } - { name: bond0 }
- { name: bond1 } - { name: bond1 }
state: absent state: absent
@ -174,7 +174,7 @@
- name: Remove collection of linkagg definitions again (idempotent) - name: Remove collection of linkagg definitions again (idempotent)
net_linkagg: net_linkagg:
collection: aggregate:
- { name: bond0 } - { name: bond0 }
- { name: bond1 } - { name: bond1 }
state: absent state: absent

@ -86,7 +86,7 @@
- name: Add logging collections - name: Add logging collections
net_logging: net_logging:
collection: aggregate:
- { dest: file, name: test1, facility: all, level: info } - { dest: file, name: test1, facility: all, level: info }
- { dest: file, name: test2, facility: news, level: debug } - { dest: file, name: test2, facility: news, level: debug }
state: present state: present
@ -101,7 +101,7 @@
- name: Add and remove logging collections with overrides - name: Add and remove logging collections with overrides
net_logging: net_logging:
collection: aggregate:
- { dest: console, facility: all, level: info } - { dest: console, facility: all, level: info }
- { dest: file, name: test1, facility: all, level: info, state: absent } - { dest: file, name: test1, facility: all, level: info, state: absent }
- { dest: console, facility: daemon, level: warning } - { dest: console, facility: daemon, level: warning }
@ -117,7 +117,7 @@
- name: Remove logging collections - name: Remove logging collections
net_logging: net_logging:
collection: aggregate:
- { dest: console, facility: all, level: info } - { dest: console, facility: all, level: info }
- { dest: console, facility: daemon, level: warning } - { dest: console, facility: daemon, level: warning }
- { dest: file, name: test2, facility: news, level: debug } - { dest: file, name: test2, facility: news, level: debug }

@ -94,7 +94,7 @@
- name: Add static route collections - name: Add static route collections
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
state: present state: present
@ -109,7 +109,7 @@
- name: Add and remove static route collections with overrides - name: Add and remove static route collections with overrides
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8, state: absent } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8, state: absent }
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
@ -125,7 +125,7 @@
- name: Remove static route collections - name: Remove static route collections
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 } - { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }

@ -82,7 +82,7 @@
- name: Add static route collections - name: Add static route collections
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 } - { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 }
state: present state: present
@ -97,7 +97,7 @@
- name: Add and remove static route collections with overrides - name: Add and remove static route collections with overrides
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent } - { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent }
- { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 }
@ -113,7 +113,7 @@
- name: Remove static route collections - name: Remove static route collections
net_static_route: net_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 }
state: absent state: absent

@ -1,7 +1,7 @@
--- ---
- name: Set multiple users role - name: Set multiple users role
net_user: net_user:
collection: aggregate:
- name: netop - name: netop
- name: netend - name: netend
role: network-operator role: network-operator

@ -73,7 +73,7 @@
- name: Teardown list of users - name: Teardown list of users
net_user: net_user:
collection: aggregate:
- {name: test_user1, state: absent} - {name: test_user1, state: absent}
- {name: test_user2, state: absent} - {name: test_user2, state: absent}
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -81,7 +81,7 @@
- name: Create list of users - name: Create list of users
net_user: net_user:
collection: aggregate:
- {name: test_user1, role: operator, state: present} - {name: test_user1, role: operator, state: present}
- {name: test_user2, role: read-only, state: present} - {name: test_user2, role: read-only, state: present}
provider: "{{ netconf }}" provider: "{{ netconf }}"
@ -101,7 +101,7 @@
- name: Delete list of users - name: Delete list of users
net_user: net_user:
collection: aggregate:
- {name: test_user1, role: operator, state: absent} - {name: test_user1, role: operator, state: absent}
- {name: test_user2, role: read-only, state: absent} - {name: test_user2, role: read-only, state: absent}
provider: "{{ netconf }}" provider: "{{ netconf }}"

@ -1,7 +1,7 @@
--- ---
- name: Set multiple users role - name: Set multiple users role
net_user: net_user:
collection: aggregate:
- name: netop - name: netop
- name: netend - name: netend
role: network-operator role: network-operator

@ -15,7 +15,7 @@
- name: Collection of users - name: Collection of users
nxos_user: nxos_user:
users: aggregate:
- name: test1 - name: test1
- name: test2 - name: test2
authorize: yes authorize: yes

@ -15,7 +15,7 @@
- name: Collection of users - name: Collection of users
nxos_user: nxos_user:
users: aggregate:
- name: test1 - name: test1
- name: test2 - name: test2
authorize: yes authorize: yes

@ -127,7 +127,7 @@
- name: Create collection of linkagg definitions - name: Create collection of linkagg definitions
vyos_linkagg: vyos_linkagg:
collection: aggregate:
- { name: bond0, members: [eth1] } - { name: bond0, members: [eth1] }
- { name: bond1, members: [eth2] } - { name: bond1, members: [eth2] }
state: present state: present
@ -143,7 +143,7 @@
- name: Create collection of linkagg definitions again (idempotent) - name: Create collection of linkagg definitions again (idempotent)
vyos_linkagg: vyos_linkagg:
collection: aggregate:
- { name: bond0, members: [eth1] } - { name: bond0, members: [eth1] }
- { name: bond1, members: [eth2] } - { name: bond1, members: [eth2] }
state: present state: present
@ -155,7 +155,7 @@
- name: Remove collection of linkagg definitions - name: Remove collection of linkagg definitions
vyos_linkagg: vyos_linkagg:
collection: aggregate:
- { name: bond0 } - { name: bond0 }
- { name: bond1 } - { name: bond1 }
state: absent state: absent
@ -171,7 +171,7 @@
- name: Remove collection of linkagg definitions again (idempotent) - name: Remove collection of linkagg definitions again (idempotent)
vyos_linkagg: vyos_linkagg:
collection: aggregate:
- { name: bond0 } - { name: bond0 }
- { name: bond1 } - { name: bond1 }
state: absent state: absent

@ -86,7 +86,7 @@
- name: Add logging collections - name: Add logging collections
vyos_logging: vyos_logging:
collection: aggregate:
- { dest: file, name: test1, facility: all, level: info } - { dest: file, name: test1, facility: all, level: info }
- { dest: file, name: test2, facility: news, level: debug } - { dest: file, name: test2, facility: news, level: debug }
state: present state: present
@ -101,7 +101,7 @@
- name: Add and remove logging collections with overrides - name: Add and remove logging collections with overrides
vyos_logging: vyos_logging:
collection: aggregate:
- { dest: console, facility: all, level: info } - { dest: console, facility: all, level: info }
- { dest: file, name: test1, facility: all, level: info, state: absent } - { dest: file, name: test1, facility: all, level: info, state: absent }
- { dest: console, facility: daemon, level: warning } - { dest: console, facility: daemon, level: warning }
@ -117,7 +117,7 @@
- name: Remove logging collections - name: Remove logging collections
vyos_logging: vyos_logging:
collection: aggregate:
- { dest: console, facility: all, level: info } - { dest: console, facility: all, level: info }
- { dest: console, facility: daemon, level: warning } - { dest: console, facility: daemon, level: warning }
- { dest: file, name: test2, facility: news, level: debug } - { dest: file, name: test2, facility: news, level: debug }

@ -82,7 +82,7 @@
- name: Add static route collections - name: Add static route collections
vyos_static_route: vyos_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 } - { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 }
state: present state: present
@ -97,7 +97,7 @@
- name: Add and remove static route collections with overrides - name: Add and remove static route collections with overrides
vyos_static_route: vyos_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent } - { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent }
- { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 }
@ -113,7 +113,7 @@
- name: Remove static route collections - name: Remove static route collections
vyos_static_route: vyos_static_route:
collection: aggregate:
- { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 }
- { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 }
state: absent state: absent

@ -15,7 +15,7 @@
- name: Collection of users (SetUp) - name: Collection of users (SetUp)
vyos_user: vyos_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
level: operator level: operator
@ -44,7 +44,7 @@
- name: Add collection of users (Idempotent) - name: Add collection of users (Idempotent)
vyos_user: vyos_user:
users: aggregate:
- name: ansibletest2 - name: ansibletest2
- name: ansibletest3 - name: ansibletest3
level: operator level: operator

Loading…
Cancel
Save