# teach netscaler module about HA clusters

**URL:** <https://forum.ansible.com/t/teach-netscaler-module-about-ha-clusters/14485>\
**Category:** Ansible Developer\
**Created:** [February 4, 2014, 12:19pm UTC](https://forum.ansible.com/t/teach-netscaler-module-about-ha-clusters/14485 "2014-02-04T12:19:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Howard\_Oettle](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@Howard\_Oettle](https://forum.ansible.com/u/Howard_Oettle)\
**Post date:** [February 4, 2014, 12:19pm UTC](https://forum.ansible.com/t/teach-netscaler-module-about-ha-clusters/14485/1 "2014-02-04T12:19:25Z")

</div>

Netscaler appliances have the potential to be deployed in clusters for high availability - one node primary, one (or more) nodes secondary. Unfortunately this can lead to cases where a user (or ansible module) can log into a secondary node which may or may not be sending your configuration changes to the primary. No matter how many times you enable or disable a server or service, it ain’t happening.

However, help is at hand! The Netscaler Nitro API exposes, amongst other things, information about all the nodes in the HA cluster: their IP and whether they’re the active node or not.

So I propose modifying the netscaler module to expose an extra parameter called ‘cluster\_aware’ or ‘resolve\_active\_node’ or something similar, which will enable the module to (upon every invocation and prior to executing the call specified by the module parameters)

- 
  1. request the JSON-encoded parameters relating to the HA cluster (if any)

- 
  1. check if the current netscaler is the primary

- 
  1. if the current netscaler is _not_ the primary, change the \_nsc\_host variable to the address of the primary

- 
  1. carry out the request as normal.

Essentially what I’m proposing is the same kind of logic in the uri module for following HTTP redirects.

Thoughts?

-Howard
