Skip to content

Commit 5e58184

Browse files
authored
Code changes to support GET on routerdynamicrouting endpoint to read data from vtysh.
Code changes to support GET on routerdynamicrouting endpoint to read data from vtysh.
2 parents f19126b + 1e93637 commit 5e58184

10 files changed

Lines changed: 479 additions & 414 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
- name: Sample routerdynamicrouting_info playbook
3+
hosts: demo_netscalers
4+
gather_facts: false
5+
tasks:
6+
- name: Get BGP routing summary
7+
delegate_to: localhost
8+
netscaler.adc.routerdynamicrouting_info:
9+
nsip: "{{ nsip }}"
10+
nitro_user: "{{ nitro_user }}"
11+
nitro_pass: "{{ nitro_pass }}"
12+
nitro_protocol: "{{ nitro_protocol }}"
13+
validate_certs: false
14+
commandstring: "show ip bgp summary"
15+
register: bgp_summary
16+
17+
- name: Display BGP summary
18+
ansible.builtin.debug:
19+
var: bgp_summary.info
20+
21+
- name: Get IP routing table
22+
delegate_to: localhost
23+
netscaler.adc.routerdynamicrouting_info:
24+
nsip: "{{ nsip }}"
25+
nitro_user: "{{ nitro_user }}"
26+
nitro_pass: "{{ nitro_pass }}"
27+
nitro_protocol: "{{ nitro_protocol }}"
28+
validate_certs: false
29+
commandstring: "sh ip route"
30+
register: ip_route
31+
32+
- name: Display routing table
33+
ansible.builtin.debug:
34+
var: ip_route.info
35+
36+
- name: Get OSPF neighbor information
37+
delegate_to: localhost
38+
netscaler.adc.routerdynamicrouting_info:
39+
nsip: "{{ nsip }}"
40+
nitro_user: "{{ nitro_user }}"
41+
nitro_pass: "{{ nitro_pass }}"
42+
nitro_protocol: "{{ nitro_protocol }}"
43+
validate_certs: false
44+
commandstring: "show ip ospf neighbor"
45+
register: ospf_neighbors
46+
47+
- name: Display OSPF neighbors
48+
ansible.builtin.debug:
49+
var: ospf_neighbors.info

plugins/module_utils/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def format_value(val):
137137
return str(val)
138138

139139
args_val = ",".join(
140-
["%s:%s" % (k, quote(codecs.encode(format_value(args[k])), safe="")) for k in args]
140+
[
141+
"%s:%s" % (k, quote(codecs.encode(format_value(args[k])), safe=""))
142+
for k in args
143+
]
141144
)
142145
args_val = ("args=%s" % args_val) if args_val != "" else ""
143146

plugins/module_utils/module_executor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,10 @@ def filter_values(value):
325325

326326
log("DEBUG: self.module.params: %s" % self.module.params)
327327
for k, v in self.module.params.items():
328-
if not k.endswith("_binding") and k in NITRO_RESOURCE_MAP[self.resource_name]["readwrite_arguments"]:
328+
if (
329+
not k.endswith("_binding")
330+
and k in NITRO_RESOURCE_MAP[self.resource_name]["readwrite_arguments"]
331+
):
329332
cleaned_value = filter_values(v)
330333
if cleaned_value is not None:
331334
self.resource_module_params[k] = cleaned_value

0 commit comments

Comments
 (0)