Module to provide Citrix Netscaler compatibility to Salt (compatible with netscaler 9.2+)
New in version 2015.2.0.
nsnitro Python module
Note
You can install nsnitro using:
pip install nsnitro
This module accepts connection configuration details either as parameters, or as configuration settings in /etc/salt/minion on the relevant minions
netscaler.host: 1.2.3.4
netscaler.user: user
netscaler.pass: password
This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar.
CLI Examples:
Calls relying on configuration passed using /etc/salt/minion, grains, or pillars:
salt-call netscaler.server_exists server_nameCalls passing configuration as opts
salt-call netscaler.server_exists server_name netscaler_host=1.2.3.4 netscaler_user=username netscaler_pass=password salt-call netscaler.server_exists server_name netscaler_host=1.2.3.5 netscaler_user=username2 netscaler_pass=password2 salt-call netscaler.server_enable server_name2 netscaler_host=1.2.3.5 salt-call netscaler.server_up server_name3 netscaler_host=1.2.3.6 netscaler_useSSL=False
Add a server Note: The default server state is ENABLED
CLI Example:
salt '*' netscaler.server_add 'serverName' 'serverIpAddress'
salt '*' netscaler.server_add 'serverName' 'serverIpAddress' 'serverState'
Delete a server
CLI Example:
salt '*' netscaler.server_delete 'serverName'
Disable a server globally
CLI Example:
salt '*' netscaler.server_disable 'serverName'
Enables a server globally
CLI Example:
salt '*' netscaler.server_enable 'serverName'
Check if a server is enabled globally
CLI Example:
salt '*' netscaler.server_enabled 'serverName'
Checks if a server exists
CLI Example:
salt '*' netscaler.server_exists 'serverName'
Update a server's attributes
CLI Example:
salt '*' netscaler.server_update 'serverName' 'serverIP'
Disable a service
CLI Example:
salt '*' netscaler.service_disable 'serviceName'
salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds'
Enable a service
CLI Example:
salt '*' netscaler.service_enable 'serviceName'
Checks if a service exists
CLI Example:
salt '*' netscaler.service_exists 'serviceName'
Checks if a service is UP
CLI Example:
salt '*' netscaler.service_up 'serviceName'
Add a new service group If no service type is specified, HTTP will be used. Most common service types: HTTP, SSL, and SSL_BRIDGE
CLI Example:
salt '*' netscaler.servicegroup_add 'serviceGroupName'
salt '*' netscaler.servicegroup_add 'serviceGroupName' 'serviceGroupType'
Delete a new service group
CLI Example:
salt '*' netscaler.servicegroup_delete 'serviceGroupName'
Checks if a service group exists
CLI Example:
salt '*' netscaler.servicegroup_exists 'serviceGroupName'
Add a server:port member to a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_add 'serviceGroupName' 'serverName' 'serverPort'
Remove a server:port member from a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_delete 'serviceGroupName' 'serverName' 'serverPort'
Disable a server:port member of a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_disable 'serviceGroupName' 'serverName' 'serverPort'
Enable a server:port member of a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_enable 'serviceGroupName' 'serverName' 'serverPort'
Check if a server:port combination is a member of a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort'
Check if a server:port combination is in state UP in a servicegroup
CLI Example:
salt '*' netscaler.servicegroup_server_up 'serviceGroupName' 'serverName' 'serverPort'
Add a new lb vserver
CLI Example:
salt '*' netscaler.vserver_add 'vserverName' 'vserverIP' 'vserverPort' 'vserverType'
salt '*' netscaler.vserver_add 'alex.patate.chaude.443' '1.2.3.4' '443' 'SSL'
Delete a lb vserver
CLI Example:
salt '*' netscaler.vserver_delete 'vserverName'
Checks if a vserver exists
CLI Example:
salt '*' netscaler.vserver_exists 'vserverName'
Bind a servicegroup to a vserver
CLI Example:
salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName'
Unbind a servicegroup from a vserver
CLI Example:
salt '*' netscaler.vserver_servicegroup_delete 'vserverName' 'serviceGroupName'
Checks if a servicegroup is tied to a vserver
CLI Example:
salt '*' netscaler.vserver_servicegroup_exists 'vserverName' 'serviceGroupName'
Binds a SSL certificate to a vserver
CLI Example:
salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName'
Unbinds a SSL certificate from a vserver
CLI Example:
salt '*' netscaler.vserver_sslcert_delete 'vserverName' 'sslCertificateName'
Checks if a SSL certificate is tied to a vserver
CLI Example:
salt '*' netscaler.vserver_sslcert_exists 'vserverName' 'sslCertificateName'