Configuring Citrix ADC CPX Using a Configuration File
Instead of using command line interface (
cli\_script.sh), NITRO API, or Citrix ADM configuration jobs to configure the Citrix ADC CPX, you can dynamically configure the Citrix ADC CPX using a static configuration file while deploying the Citrix ADC CPX instance.
You can provide a static configuration file as an input file while deploying the Citrix ADC CPX container. During Citrix ADC CPX container startup, the container is configured based on the configuration specified in the static configuration file. This configuration includes Citrix ADC-specific configuration and bash shell commands that you can dynamically run on the Citrix ADC CPX container.
Structure of the static configuration file
As mentioned above, when Citrix ADC CPX is deployed, it is configured based on the configurations specified in the static configuration file.
The static configuration file is a
.conf file that includes two tags,
#Citrix ADC Commands and
#Shell Commands. Under the
#Citrix ADC Commands tag, you must add all the Citrix ADC commands to configure Citrix ADC-specific configuration on Citrix ADC CPX. Under the
#Shell Commands tag, you must add the shell commands that you want to run on Citrix ADC CPX.
During the Citrix ADC CPX container deployment, the Citrix ADC commands and shell commands are executed on the container in the order specified in the configuration file.
- The tags can be repeated multiple times in the configuration file.
- The tags are not case-sensitive.
- The configuration file must be present in
cpx.conffile in the container’s file system.
- The configuration file can also include comments. You need to add a “#” character before your comments.
- If there are failure scenarios while deploying the Citrix ADC CPX container with the configuration file, the failures are logged in the
ns.logfile in the container.
- When you reboot the Citrix ADC CPX container the configuration file is re-applied on the container.
#Citrix ADC Commands add lb vserver v1 http 126.96.36.199 80 add service s1 188.8.131.52 http 80 bind lb vserver v1 s1 #Shell Commands touch /etc/a.txt echo "this is a" > /etc/a.txt #Citrix ADC Commands add lb vserver v2 http #Shell Commands echo "this is a 1" >> /etc/a.txt #Citrix ADC Commands add lb vserver v3 http #This is a test configuration file
To install a Citrix ADC CPX container and to dynamically configure the Citrix ADC CPX container based on a configuration file, mount the static configuration file using the
- 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/netscalercpx:12.1-48.13