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 this 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 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: