community.network.netscaler_cs_policy module – Manage content switching policy
Note
This module is part of the community.network collection (version 3.3.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.netscaler_cs_policy
.
Synopsis
Manage content switching policy.
This module is intended to run either on the ansible control node or a bastion (jumpserver) with access to the actual netscaler instance.
Requirements
The below requirements are needed on the host that executes this module.
nitro python sdk
Parameters
Parameter |
Comments |
---|---|
Content switching action that names the target load balancing virtual server to which the traffic is switched. |
|
The domain name. The string value can range to 63 characters. Minimum length = 1 |
|
The password with which to authenticate to the netscaler node. |
|
Which protocol to use when accessing the nitro API objects. Choices:
|
|
Time in seconds until a timeout error is thrown when establishing a new session with Netscaler Default: 310 |
|
The username with which to authenticate to the netscaler node. |
|
The ip address of the netscaler appliance where the nitro API calls will be made. The port can be specified with the colon (:). E.g. 192.168.1.1:555. |
|
Name for the content switching policy. Must begin with an ASCII alphanumeric or underscore The following requirement applies only to the NetScaler CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, my policy or my policy). Minimum length = 1 |
|
Expression, or name of a named expression, against which traffic is evaluated. Written in the classic or default syntax. Note: Maximum length of a string literal in the expression is 255 characters. A longer string can be split into smaller strings of up to 255 characters each, and the smaller strings concatenated with the + operator. For example, you can create a 500-character string as follows: ‘”<string of 255 characters>” + “<string of 245 characters>”’ |
|
If The module will not save the configuration on the netscaler node if it made no changes. Choices:
|
|
The state of the resource being configured by the module on the netscaler node. When present the resource will be created if needed and configured according to the module’s parameters. When absent the resource will be deleted from the netscaler node. Choices:
|
|
URL string that is matched with the URL of a request. Can contain a wildcard character. Specify the string value in the following format: Minimum length = 1 Maximum length = 208 |
|
If Choices:
|
Notes
Note
For more information on using Ansible to manage Citrix NetScaler Network devices see https://www.ansible.com/ansible-netscaler.
Examples
- name: Create url cs policy
delegate_to: localhost
community.network.netscaler_cs_policy:
nsip: 172.18.0.2
nitro_user: nsroot
nitro_pass: nsroot
validate_certs: no
state: present
policyname: policy_1
url: /example/
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
List of differences between the actual configured object and the configuration specified in the module Returned: failure Sample: {“url”: “difference. ours: (str) example1 other: (str) /example1”} |
|
list of logged messages by the module Returned: always Sample: [“message 1”, “message 2”] |
|
Message detailing the failure reason Returned: failure Sample: “Could not load nitro python sdk” |
Authors
George Nikolopoulos (@giorgos-nikolopoulos)