Configuring NetScaler CPX Using a Configuration File
cli_script.sh), NITRO API, or NetScaler Console configuration jobs to configure the NetScaler CPX, you can configure the NetScaler CPX using a static configuration file while deploying the NetScaler CPX instance.
Structure of the static configuration file
.conf file that includes two tags, #NetScaler Commands and #Shell Commands. Under the #NetScaler Commands tag, you must add all the NetScaler commands to configure NetScaler-specific configuration on NetScaler CPX. Under the #Shell Commands tag, you must add the shell commands that you want to run on NetScaler CPX.
-
The tags can be repeated multiple times in the configuration file.
-
The tags are not case-sensitive.
-
The configuration file must be present in the
/etcdirectory ascpx.conffile in the container’s file system. -
The configuration file can also include comments. You must add a “#” character before your comments.
-
If there are failure scenarios while deploying the NetScaler CPX container with the configuration file, the failures are logged in the
ns.logfile in the container. -
When you reboot the NetScaler CPX container the configuration file is reapplied on the container.
#NetScaler Commands
add lb vserver v1 http 1.1.1.1 80
add service s1 2.2.2.2 http 80
bind lb vserver v1 s1
#Shell Commands
touch /etc/a.txt
echo "this is a" > /etc/a.txt
#NetScaler Commands
add lb vserver v2 http
#Shell Commands
echo "this is a 1" >> /etc/a.txt
#NetScaler Commands
add lb vserver v3 http
#This is a test configuration file
- v option in the docker run command:
docker run -dt --privileged=true -e EULA=yes --ulimit core=-1 -v /tmp/cpx.conf:/etc/cpx.conf --name mycpx store/citrix/citrixadccpx:13.0-x.x