Skip to content

Commit e9d9811

Browse files
author
Shiva Shankar Vaddepally
committed
supporting ospf6interface, ospf6router, routermap
Signed-off-by: Shiva Shankar Vaddepally <[email protected]>
1 parent 1b3f9a6 commit e9d9811

14 files changed

Lines changed: 692 additions & 9 deletions

examples/location.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
delegate_to: localhost
88
netscaler.adc.location:
99
state: present
10-
nsip: 10.106.210.21
11-
nitro_user: nsroot
12-
nitro_pass: notnsroot
13-
nitro_protocol: http
14-
validate_certs: false
1510
ipfrom: "170.173.217.0"
1611
ipto: "170.173.222.255"
1712
preferredlocation: "prov.WA.sdc.*.*.*"

examples/ospf6interface.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- name: Configure ospf6interface
3+
hosts: localhost
4+
tasks:
5+
- name: Create ospf6interface
6+
delegate_to: localhost
7+
netscaler.adc.ospf6interface:
8+
state: present
9+
name: vlan0
10+
areaId: 0
11+
tagId: "22"
12+
instanceId: 0

examples/ospf6router.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
- name: Sample ospf6router playbook
3+
hosts: localhost
4+
gather_facts: false
5+
tasks:
6+
- name: Configure ospf6router
7+
delegate_to: localhost
8+
netscaler.adc.ospf6router:
9+
state: present
10+
tagId: 11
11+
routerId: 1.1.1.1
12+
afParams:
13+
- addressFamily: ipv6

examples/routemap.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- name: Sample routeMap playbook
3+
hosts: localhost
4+
gather_facts: false
5+
tasks:
6+
- name: Configure routeMap
7+
delegate_to: localhost
8+
netscaler.adc.routemap:
9+
state: present
10+
name: test
11+
rules:
12+
- action: permit
13+
sequence: 10
14+
setMetric: 300
15+
matchAsPath: "300"

meta/runtime.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,3 +984,6 @@ action_groups:
984984
- accesslist
985985
- bfdinterface
986986
- iproute
987+
- routemap
988+
- ospf6interface
989+
- ospf6router

plugins/module_utils/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
"bfdinterface",
159159
"iproute",
160160
"ospf6interface",
161+
"routemap",
162+
"ospf6router",
161163
]
162164

163165
DYNAMIC_PROTOCOLS_ALIAS = {
@@ -169,4 +171,8 @@
169171
"ipRoute": "iproute",
170172
"ospf6interface": "ospf6Interface",
171173
"ospf6Interface": "ospf6interface",
174+
"routemap": "routeMap",
175+
"routeMap": "routemap",
176+
"ospf6router": "ospf6Router",
177+
"ospf6Router": "ospf6router",
172178
}

plugins/module_utils/module_executor.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,24 @@ def _filter_resource_module_params(self):
315315
# defined in the playbook, it's value will be None. So, filter out those attributes.
316316
# Also, filter out attributes ending with `_binding` as they are handled separately
317317
if v is not None:
318-
self.resource_module_params[k] = v
318+
if isinstance(v, list):
319+
filtered_list = []
320+
for listitem in v:
321+
if isinstance(listitem, dict):
322+
filtered_dict = {
323+
key: value
324+
for key, value in listitem.items()
325+
if value is not None
326+
}
327+
if filtered_dict:
328+
filtered_list.append(filtered_dict)
329+
else:
330+
if listitem is not None:
331+
filtered_list.append(listitem)
332+
if filtered_list:
333+
self.resource_module_params[k] = filtered_list
334+
else:
335+
self.resource_module_params[k] = v
319336

320337
if self.resource_name in NITRO_ATTRIBUTES_ALIASES:
321338
self.resource_module_params = self._add_nitro_attributes_aliases(

plugins/module_utils/nitro_resource_map.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46850,6 +46850,65 @@
4685046850
"transmitDelay",
4685146851
],
4685246852
},
46853+
"ospf6router": {
46854+
"_supported_operations": [
46855+
"add",
46856+
"get",
46857+
"unset",
46858+
"update",
46859+
"delete",
46860+
],
46861+
"action_payload_keys": {
46862+
"apply": [],
46863+
"create": [],
46864+
"force": [],
46865+
"import": [],
46866+
"link": [],
46867+
"switch": [],
46868+
"unlink": [],
46869+
"unset": ["afParams", "passiveInterface", "routerId", "tagId"],
46870+
},
46871+
"add_payload_keys": ["afParams", "passiveInterface", "routerId", "tagId"],
46872+
"bindings": [],
46873+
"bindprimary_key": "",
46874+
"delete_arg_keys": ["tagId"],
46875+
"disable_payload_keys": [],
46876+
"enable_payload_keys": [],
46877+
"get_arg_keys": ["tagId"],
46878+
"immutable_keys": [],
46879+
"password_keys": [],
46880+
"primary_key": "",
46881+
"primary_key_composite": [],
46882+
"readwrite_arguments": {
46883+
"afParams": {
46884+
"type": "list",
46885+
"elements": "dict",
46886+
"options": {
46887+
"addressFamily": {"no_log": False, "type": "str"},
46888+
"redistribute": {
46889+
"type": "list",
46890+
"elements": "dict",
46891+
"options": {
46892+
"metric": {"no_log": False, "type": "int"},
46893+
"metricType": {"no_log": False, "type": "int"},
46894+
"protocol": {"no_log": False, "type": "str"},
46895+
"routeMap": {"no_log": False, "type": "str"},
46896+
},
46897+
},
46898+
},
46899+
},
46900+
"passiveInterface": {"no_log": False, "type": "list", "elements": "str"},
46901+
"routerId": {"no_log": False, "type": "str"},
46902+
"tagId": {"no_log": False, "type": "str"},
46903+
},
46904+
"singleton": False,
46905+
"update_payload_keys": [
46906+
"afParams",
46907+
"passiveInterface",
46908+
"routerId",
46909+
"tagId",
46910+
],
46911+
},
4685346912
"onlinkipv6prefix": {
4685446913
"_supported_operations": [
4685546914
"add",
@@ -50131,6 +50190,62 @@
5013150190
"weight",
5013250191
],
5013350192
},
50193+
"routemap": {
50194+
"_supported_operations": [
50195+
"add",
50196+
"delete",
50197+
"get",
50198+
"unset",
50199+
"update",
50200+
],
50201+
"action_payload_keys": {
50202+
"apply": [],
50203+
"create": [],
50204+
"force": [],
50205+
"import": [],
50206+
"link": [],
50207+
"switch": [],
50208+
"unlink": [],
50209+
"unset": ["name", "rules"],
50210+
},
50211+
"add_payload_keys": ["name", "rules"],
50212+
"bindings": [],
50213+
"bindprimary_key": "",
50214+
"delete_arg_keys": ["name"],
50215+
"disable_payload_keys": [],
50216+
"enable_payload_keys": [],
50217+
"get_arg_keys": ["name"],
50218+
"immutable_keys": [],
50219+
"password_keys": [],
50220+
"primary_key": "",
50221+
"primary_key_composite": [],
50222+
"readwrite_arguments": {
50223+
"name": {"no_log": False, "type": "str"},
50224+
"rules": {
50225+
"type": "list",
50226+
"elements": "dict",
50227+
"options": {
50228+
"action": {"no_log": False, "type": "str"},
50229+
"localPreference": {"no_log": False, "type": "int"},
50230+
"matchAsPath": {"no_log": False, "type": "str"},
50231+
"matchCommunity": {"no_log": False, "type": "str"},
50232+
"matchIpAddress": {"no_log": False, "type": "str"},
50233+
"matchIpNextHop": {"no_log": False, "type": "str"},
50234+
"matchMetric": {"no_log": False, "type": "int"},
50235+
"matchRouteType": {"no_log": False, "type": "str"},
50236+
"sequence": {"no_log": False, "type": "int"},
50237+
"setAsPath": {"no_log": False, "type": "str"},
50238+
"setCommunity": {"no_log": False, "type": "str"},
50239+
"setIpNextHop": {"no_log": False, "type": "str"},
50240+
"setMetric": {"no_log": False, "type": "int"},
50241+
"setMetricType": {"no_log": False, "type": "str"},
50242+
"weight": {"no_log": False, "type": "int"},
50243+
},
50244+
},
50245+
},
50246+
"singleton": False,
50247+
"update_payload_keys": ["rules"],
50248+
},
5013450249
"routerdynamicrouting": {
5013550250
"_supported_operations": [
5013650251
"add",

0 commit comments

Comments
 (0)