File tree 1 file changed +15
-1
lines changed
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'
20
20
. /etc/os-release
21
21
22
22
AGENT_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" }
23
24
24
25
#
25
26
# Functions
@@ -66,6 +67,19 @@ update_config_file() {
66
67
token=` grep " token:" " ${v2_config_file} " `
67
68
token=` echo $token | cut -d " :" -f 2 | xargs`
68
69
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
+
69
83
config_dirs=` grep " config_dirs:" " ${v2_config_file} " `
70
84
config_dirs=` echo $config_dirs | cut -d " \" " -f 2`
71
85
91
105
path: /var/log/nginx-agent/
92
106
93
107
allowed_directories: ${allowed_directories}
94
-
108
+ ${labels}
95
109
command:
96
110
server:
97
111
host: ${NGINX_ONE_HOST}
You can’t perform that action at this time.
0 commit comments