Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions examples/routerdynamicrouting_info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
- name: Sample routerdynamicrouting_info playbook
hosts: demo_netscalers
gather_facts: false
tasks:
- name: Get BGP routing summary
delegate_to: localhost
netscaler.adc.routerdynamicrouting_info:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
nitro_protocol: "{{ nitro_protocol }}"
validate_certs: false
commandstring: "show ip bgp summary"
register: bgp_summary

- name: Display BGP summary
ansible.builtin.debug:
var: bgp_summary.info

- name: Get IP routing table
delegate_to: localhost
netscaler.adc.routerdynamicrouting_info:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
nitro_protocol: "{{ nitro_protocol }}"
validate_certs: false
commandstring: "sh ip route"
register: ip_route

- name: Display routing table
ansible.builtin.debug:
var: ip_route.info

- name: Get OSPF neighbor information
delegate_to: localhost
netscaler.adc.routerdynamicrouting_info:
nsip: "{{ nsip }}"
nitro_user: "{{ nitro_user }}"
nitro_pass: "{{ nitro_pass }}"
nitro_protocol: "{{ nitro_protocol }}"
validate_certs: false
commandstring: "show ip ospf neighbor"
register: ospf_neighbors

- name: Display OSPF neighbors
ansible.builtin.debug:
var: ospf_neighbors.info
5 changes: 4 additions & 1 deletion plugins/module_utils/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ def format_value(val):
return str(val)

args_val = ",".join(
["%s:%s" % (k, quote(codecs.encode(format_value(args[k])), safe="")) for k in args]
[
"%s:%s" % (k, quote(codecs.encode(format_value(args[k])), safe=""))
for k in args
]
)
args_val = ("args=%s" % args_val) if args_val != "" else ""

Expand Down
5 changes: 4 additions & 1 deletion plugins/module_utils/module_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ def filter_values(value):

log("DEBUG: self.module.params: %s" % self.module.params)
for k, v in self.module.params.items():
if not k.endswith("_binding") and k in NITRO_RESOURCE_MAP[self.resource_name]["readwrite_arguments"]:
if (
not k.endswith("_binding")
and k in NITRO_RESOURCE_MAP[self.resource_name]["readwrite_arguments"]
):
cleaned_value = filter_values(v)
if cleaned_value is not None:
self.resource_module_params[k] = cleaned_value
Expand Down
Loading
Loading