# salt.modules.netscaler

Module to provide Citrix Netscaler compatibility to Salt (compatible with netscaler 9.2+)

Added in version 2015.2.0.

depends:

- nsnitro Python module

Note

You can install nsnitro using:

    pip install nsnitro

configuration:

  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_name

> Calls 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

salt.modules.netscaler.server_add(s_name, s_ip, s_state=None, **connection_args)

  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'

salt.modules.netscaler.server_delete(s_name, **connection_args)

  Delete a server

  CLI Example:

      salt '*' netscaler.server_delete 'serverName'

salt.modules.netscaler.server_disable(s_name, **connection_args)

  Disable a server globally

  CLI Example:

      salt '*' netscaler.server_disable 'serverName'

salt.modules.netscaler.server_enable(s_name, **connection_args)

  Enables a server globally

  CLI Example:

      salt '*' netscaler.server_enable 'serverName'

salt.modules.netscaler.server_enabled(s_name, **connection_args)

  Check if a server is enabled globally

  CLI Example:

      salt '*' netscaler.server_enabled 'serverName'

salt.modules.netscaler.server_exists(s_name, ip=None, s_state=None, **connection_args)

  Checks if a server exists

  CLI Example:

      salt '*' netscaler.server_exists 'serverName'

salt.modules.netscaler.server_update(s_name, s_ip, **connection_args)

  Update a server's attributes

  CLI Example:

      salt '*' netscaler.server_update 'serverName' 'serverIP'

salt.modules.netscaler.service_disable(s_name, s_delay=None, **connection_args)

  Disable a service

  CLI Example:

      salt '*' netscaler.service_disable 'serviceName'
      salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds'

salt.modules.netscaler.service_enable(s_name, **connection_args)

  Enable a service

  CLI Example:

      salt '*' netscaler.service_enable 'serviceName'

salt.modules.netscaler.service_exists(s_name, **connection_args)

  Checks if a service exists

  CLI Example:

      salt '*' netscaler.service_exists 'serviceName'

salt.modules.netscaler.service_up(s_name, **connection_args)

  Checks if a service is UP

  CLI Example:

      salt '*' netscaler.service_up 'serviceName'

salt.modules.netscaler.servicegroup_add(sg_name, sg_type='HTTP', **connection_args)

  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'

salt.modules.netscaler.servicegroup_delete(sg_name, **connection_args)

  Delete a new service group

  CLI Example:

      salt '*' netscaler.servicegroup_delete 'serviceGroupName'

salt.modules.netscaler.servicegroup_exists(sg_name, sg_type=None, **connection_args)

  Checks if a service group exists

  CLI Example:

      salt '*' netscaler.servicegroup_exists 'serviceGroupName'

salt.modules.netscaler.servicegroup_server_add(sg_name, s_name, s_port, **connection_args)

  Add a server:port member to a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_add 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.servicegroup_server_delete(sg_name, s_name, s_port, **connection_args)

  Remove a server:port member from a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_delete 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.servicegroup_server_disable(sg_name, s_name, s_port, **connection_args)

  Disable a server:port member of a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_disable 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.servicegroup_server_enable(sg_name, s_name, s_port, **connection_args)

  Enable a server:port member of a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_enable 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.servicegroup_server_exists(sg_name, s_name, s_port=None, **connection_args)

  Check if a server:port combination is a member of a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.servicegroup_server_up(sg_name, s_name, s_port, **connection_args)

  Check if a server:port combination is in state UP in a servicegroup

  CLI Example:

      salt '*' netscaler.servicegroup_server_up 'serviceGroupName' 'serverName' 'serverPort'

salt.modules.netscaler.vserver_add(v_name, v_ip, v_port, v_type, **connection_args)

  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'

salt.modules.netscaler.vserver_delete(v_name, **connection_args)

  Delete a lb vserver

  CLI Example:

      salt '*' netscaler.vserver_delete 'vserverName'

salt.modules.netscaler.vserver_exists(v_name, v_ip=None, v_port=None, v_type=None, **connection_args)

  Checks if a vserver exists

  CLI Example:

      salt '*' netscaler.vserver_exists 'vserverName'

salt.modules.netscaler.vserver_servicegroup_add(v_name, sg_name, **connection_args)

  Bind a servicegroup to a vserver

  CLI Example:

      salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName'

salt.modules.netscaler.vserver_servicegroup_delete(v_name, sg_name, **connection_args)

  Unbind a servicegroup from a vserver

  CLI Example:

      salt '*' netscaler.vserver_servicegroup_delete 'vserverName' 'serviceGroupName'

salt.modules.netscaler.vserver_servicegroup_exists(v_name, sg_name, **connection_args)

  Checks if a servicegroup is tied to a vserver

  CLI Example:

      salt '*' netscaler.vserver_servicegroup_exists 'vserverName' 'serviceGroupName'

salt.modules.netscaler.vserver_sslcert_add(v_name, sc_name, **connection_args)

  Binds a SSL certificate to a vserver

  CLI Example:

      salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName'

salt.modules.netscaler.vserver_sslcert_delete(v_name, sc_name, **connection_args)

  Unbinds a SSL certificate from a vserver

  CLI Example:

      salt '*' netscaler.vserver_sslcert_delete 'vserverName' 'sslCertificateName'

salt.modules.netscaler.vserver_sslcert_exists(v_name, sc_name, **connection_args)

  Checks if a SSL certificate is tied to a vserver

  CLI Example:

      salt '*' netscaler.vserver_sslcert_exists 'vserverName' 'sslCertificateName'