@@ -59,7 +59,7 @@ preInstall:
59
59
echo "docker detected with environ, unsupported" >&2
60
60
exit 131
61
61
fi
62
- if [[ -f /.dockerenv ] ] ; then
62
+ if [ -f /.dockerenv ] ; then
63
63
echo "docker detected with .dockerenv, unsupported" >&2
64
64
exit 131
65
65
fi
@@ -154,13 +154,13 @@ install:
154
154
exit 15
155
155
fi
156
156
- |
157
- if [[ {{.AMAZON_LINUX_VERSION}} != "2" && {{.AMAZON_LINUX_VERSION}} != "2023" ] ] ; then
158
- REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent /linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
157
+ if [ " {{.AMAZON_LINUX_VERSION}}" != "2" ] && [ " {{.AMAZON_LINUX_VERSION}}" != "2023" ] ; then
158
+ REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview /linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
159
159
else
160
- REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent /linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
160
+ REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview /linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
161
161
fi
162
162
IS_NEWRELIC_AVAILABLE=$(curl -Ls $REPO_URL | grep "\[newrelic-infra\]" | wc -l)
163
- if [ $IS_INFRA_AVAILABLE -eq 0 ] ; then
163
+ if [ $IS_NEWRELIC_AVAILABLE -eq 0 ] ; then
164
164
echo "there is no newrelic super agent available for the distribution '{{.DISTRO_VERSION}}'." >&2
165
165
exit 21
166
166
fi
@@ -225,18 +225,22 @@ install:
225
225
install_super_agent :
226
226
cmds :
227
227
- |
228
- if [[ {{.AMAZON_LINUX_VERSION}} != "2" && {{.AMAZON_LINUX_VERSION}} != "2023" ] ] ; then
229
- REPO_URL =$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
228
+ if [ " {{.AMAZON_LINUX_VERSION}}" != "2" ] && [ " {{.AMAZON_LINUX_VERSION}}" != "2023" ] ; then
229
+ SUPER_AGENT_REPO_URL =$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
230
230
else
231
- REPO_URL =$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
231
+ SUPER_AGENT_REPO_URL =$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}preview/linux/yum/{{.REPO_DIR}}/{{.AMAZON_LINUX_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
232
232
fi
233
- IS_NEWRELIC_AVAILABLE=$(curl -Ls $REPO_URL | grep "\[newrelic-infra\]" | wc -l)
233
+ IS_NEWRELIC_AVAILABLE=$(curl -Ls $SUPER_AGENT_REPO_URL | grep "\[newrelic-infra\]" | wc -l)
234
234
if [ $IS_NEWRELIC_AVAILABLE -eq 0 ] ; then
235
- echo "newrelic super agent is not available for this architecture "$ ARCH" . See our documentation for installing manually https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/install-new-relic" >&2
235
+ echo "newrelic super agent is not available for this architecture {{. ARCH}} . See our documentation for installing manually https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/install-configure/install-new-relic" >&2
236
236
exit 131
237
- fi
238
- curl -s $REPO_URL -o /etc/yum.repos.d/newrelic-infra.repo
239
- yum -y -q makecache --disablerepo='*' --enablerepo='newrelic-infra'
237
+ fi
238
+ INFRA_REPO_URL=$(echo -n "{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/linux/yum/el/{{.DISTRO_VERSION}}/{{.ARCH}}/newrelic-infra.repo")
239
+
240
+ curl -s $INFRA_REPO_URL -o /etc/yum.repos.d/newrelic-infra.repo
241
+ curl -s $SUPER_AGENT_REPO_URL | sed 's/\[newrelic-infra]/\n[newrelic-super-agent]/g' >> /etc/yum.repos.d/newrelic-infra.repo
242
+
243
+ yum -y -q makecache --disablerepo='*' --enablerepo='newrelic-infra' --enablerepo='newrelic-super-agent'
240
244
yum -y -q install newrelic-super-agent
241
245
vars :
242
246
DISTRO_VERSION :
@@ -272,21 +276,21 @@ install:
272
276
config_supervisors :
273
277
cmds :
274
278
- |
275
- if [ "{{.NR_CLI_INFRA_AGENT}}" == "false" && "{{.NR_CLI_NRDOT}}" = = "false" ] ; then
279
+ if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
276
280
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
277
281
else
278
282
sed -i 's/s*#\s*agents:/agents:/g' /etc/newrelic-super-agent/config.yaml
279
283
fi
280
284
- |
281
- if [ "{{.NR_CLI_INFRA_AGENT}}" == "false" ] ; then
285
+ if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] ; then
282
286
sed -i '/^\s*nr_infra_agent:/s/^/#/' /etc/newrelic-super-agent/config.yaml
283
287
sed -i '/^\s*agent_type: "newrelic\/com\.newrelic\.infrastructure_agent/s/^/#/' /etc/newrelic-super-agent/config.yaml
284
288
else
285
289
sed -i '/^\s*#\s*nr_infra_agent:/s/#//' /etc/newrelic-super-agent/config.yaml
286
290
sed -i '/^\s*#\s*agent_type: "newrelic\/com\.newrelic\.infrastructure_agent/s/#//' /etc/newrelic-super-agent/config.yaml
287
291
fi
288
292
- |
289
- if [ "{{.NR_CLI_NRDOT}}" == "false" ] ; then
293
+ if [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
290
294
sed -i '/^\s*nr_otel_collector:/s/^/#/' /etc/newrelic-super-agent/config.yaml
291
295
sed -i '/^\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/^/#/' /etc/newrelic-super-agent/config.yaml
292
296
else
@@ -300,7 +304,7 @@ install:
300
304
config_opamp :
301
305
cmds :
302
306
- |
303
- if [ "{{.NR_CLI_FLEET_ENABLED}}" == "false" ] ; then
307
+ if [ "{{.NR_CLI_FLEET_ENABLED}}" = "false" ] ; then
304
308
sed -i '/^\s*opamp:/s/^/#/' /etc/newrelic-super-agent/config.yaml
305
309
sed -i '/^\s*endpoint: https:\/\/opamp/s/^/#/' /etc/newrelic-super-agent/config.yaml
306
310
sed -i '/^\s*api-key:/s/^/#/' /etc/newrelic-super-agent/config.yaml
@@ -327,7 +331,7 @@ install:
327
331
config_host_monitoring :
328
332
cmds :
329
333
- |
330
- if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" == "otel" ]; then
334
+ if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" = "otel" ]; then
331
335
echo 'is_secure_forward_only: true' >> /etc/newrelic-infra.yml
332
336
else
333
337
if [ -f /etc/nr-otel-collector/config.yaml ]; then
0 commit comments