Removing a Citrix Netscaler/ADC VIP manually is not very hard but you need to remove the cs vserver , the lb veserver, the service, and the servers. If you have more than one to remove it will take some time and it is also error-prone. Automation can solve these things and Ansible is pretty easy to use.
So I want to share with you the below ansible playbook that removes one or as many VIPs as you like. It was written to remove cs vserver VIPs but it can easily be adapted to remove lb vserver VIPs also.(you only have to put the lb’s in the list and skip the cs modules using –skip-tags argument when you run the playbook).
The playbook only needs the VIP name specified in the VIPs file. After that using nitro API calls, it will fetch the lb name, services, and servers. All these are put in some variables and using the ansible Netscaler modules, they are removed.
Here you can find the files for this project:
https://github.com/czirakim/remove-netscaler-vip