This is a reference automation for pushing configurations from Git to Nginx Instance Manager, that allows a user to manage configurations for instances and instance groups keeping Git as the source of truth.
- bash shell
- Installed Nginx Instance Manager with atleast one Instance and Instance Group.
-
To clone this repository,
git clone https://github.com/nginxinc/git-automation.git -
Once you have cloned the repository, modify the following variables in
gitlab-ci.yamlfile:CTRL_IP - IP for Nginx Instance Manager. AUTH_TOKEN - Authorization token for connecting to Nginx Instance Manager. SYSTEM_UID - System UID of the instance to push configuration changes. NGINX_UID - Nginx UID of the instance to push configuration changes. GROUP_UID - Instance Group UID of the instance group to push configurations changes. -
This repository has sample script files to create payload for instances prepare-payload.sh and instance groups prepare-instGroup-payload.sh
Usage example for prepare-payload.sh :
./prepare-payload.sh ${CTRL_IP} ${AUTH_TOKEN} ${SYSTEM_UID} ${NGINX_UID}Usage example for prepare-instGroup-payload.sh :
./prepare-instGroup-payload.sh ${CTRL_IP} ${AUTH_TOKEN} ${GROUP_UID} -
Once you commit, push your changes upstream a separate pipeline should be triggered for instance or instances groups depending if changes are made in the config files for it. You can specify the default path for config files using environment variables.
DEFAULT_INSTANCE_CONFIG_FILE_PATH : Config file location for Instances. DEFAULT_INSTANCE_GROUP_CONFIG_FILE_PATH: Config file location Instance Groups. -
Once the pipeline is triggered, it will create a valid payload with
externalIdset as the git commit ID and send aPOSTrequest to Nginx Instance Manager to apply the new configuration changes.
Please see the contributing guide for guidelines on how to best contribute to this project.
© F5, Inc. 2023