ansible-collection-netscaleradc icon indicating copy to clipboard operation
ansible-collection-netscaleradc copied to clipboard

[FEATURE REQUEST] _info modules

Open fa-elepape opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. While the new collection lets Ansible manage pretty much all aspects of Netscaler, it's not currently possible to retrieve information from them.

In my current case, I'm attempting to renew certificates which are relatively close to expiry but retrieving that information is not readily available from _info modules (see vmware.vmware_rest for an example) which means I have to fall back to using the ansible.builtin.uri module to perform those requests.

I'm raising this feature request to make this more "Ansibly" but it's clearly not a blocker.

Describe the solution you'd like Add corresponding _info modules to the existing modules.

Describe alternatives you've considered Again, this is not (for me) a blocking issue since I can perform the requests manually for now, it's just more cumbersome.

fa-elepape avatar Nov 02 '23 17:11 fa-elepape

@fa-elepape, thank you for the enhancement request. This is a very apt ask. We will definitely keep this in our planning.

Can you please share your workaround using ansible.builtin.uri which you mentioned?

sumanth-lingappa avatar Nov 15 '23 05:11 sumanth-lingappa

Sure! It's really just a dump of the /sslcertkey endpoint of the NITRO API which can then be manipulated using Ansible. It's quite close to what was documented in the citrix.adc branch.

ansible.builtin.uri:
  url: "{{ nitro_protocol }}://{{ nsip }}/nitro/v1/config/sslcertkey"
  method: GET
  status_code: 200
  return_content: yes
  headers:
    X-NITRO-USER: "{{ nitro_user }}"
    X-NITRO-PASS: "{{ nitro_pass }}"
  validate_certs: "{{ validate_certs }}"
vars:
  nitro_pass: "{{ netscaler_nitro_pass | default(lookup('ansible.builtin.env', 'NETSCALER_NITRO_PASS', default=omit)) }}"
  nitro_protocol: "{{ netscaler_nitro_protocol | default(lookup('ansible.builtin.env', 'NETSCALER_NITRO_PROTOCOL')) }}"
  nitro_user: "{{ netscaler_nitro_user | default(lookup('ansible.builtin.env', 'NETSCALER_NITRO_USER', default=omit)) }}"
  nsip: "{{ netscaler_nsip | default(lookup('ansible.builtin.env', 'NETSCALER_NSIP', default=omit)) }}"
  validate_certs: "{{ netscaler_validate_certs | default(lookup('ansible.builtin.env', 'NETSCALER_VALIDATE_CERTS', default=omit)) }}"

fa-elepape avatar Nov 15 '23 12:11 fa-elepape