File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ NO_COLOUR='\033[0m'
2020. /etc/os-release
2121
2222AGENT_CONFIG_FILE=${AGENT_CONFIG_FILE:- " /etc/nginx-agent/nginx-agent.conf" }
23+ AGENT_DYNAMIC_CONFIG_FILE=${AGENT_DYNAMIC_CONFIG_FILE:- " /var/lib/nginx-agent/agent-dynamic.conf" }
2324
2425#
2526# Functions
@@ -66,6 +67,19 @@ update_config_file() {
6667 token=` grep " token:" " ${v2_config_file} " `
6768 token=` echo $token | cut -d " :" -f 2 | xargs`
6869
70+ instance_group=` grep " instance_group:" " ${AGENT_DYNAMIC_CONFIG_FILE} " `
71+ instance_group=` echo $instance_group | cut -d " :" -f 2 | xargs`
72+
73+ labels=" "
74+
75+ if [ -n " ${instance_group} " ]; then
76+ echo " Adding config sync group to NGINX Agent configuration"
77+ labels="
78+ labels:
79+ config-sync-group: ${instance_group}
80+ "
81+ fi
82+
6983 config_dirs=` grep " config_dirs:" " ${v2_config_file} " `
7084 config_dirs=` echo $config_dirs | cut -d " \" " -f 2`
7185
91105 path: /var/log/nginx-agent/
92106
93107allowed_directories: ${allowed_directories}
94-
108+ ${labels}
95109command:
96110 server:
97111 host: ${NGINX_ONE_HOST}
You can’t perform that action at this time.
0 commit comments