From cc0204a337f731f7147750ca96e8b57da4bf1474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Tue, 28 Nov 2023 14:35:46 +0000 Subject: [PATCH] feat: create sub-agent directory --- recipes/newrelic/infrastructure/super-agent/debian.yml | 8 +++++--- recipes/newrelic/infrastructure/super-agent/rhel.yml | 8 +++++--- recipes/newrelic/infrastructure/super-agent/suse.yml | 10 +++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index 629ab579d..c542048af 100644 --- a/recipes/newrelic/infrastructure/super-agent/debian.yml +++ b/recipes/newrelic/infrastructure/super-agent/debian.yml @@ -330,12 +330,14 @@ install: - | # Remove old config location (to deprecate) rm -f /etc/newrelic-super-agent/nrdot-values.yaml + # Create nr_otel_collector sub-agent dir + mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then - echo 'otel_exporter_otlp_endpoint: "otlp.eu01.nr-data.net:4317"' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'otel_exporter_otlp_endpoint: "otlp.eu01.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml else - echo 'otel_exporter_otlp_endpoint: "otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'otel_exporter_otlp_endpoint: "otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml fi config_supervisors: diff --git a/recipes/newrelic/infrastructure/super-agent/rhel.yml b/recipes/newrelic/infrastructure/super-agent/rhel.yml index 1cbc6511b..3d233791b 100644 --- a/recipes/newrelic/infrastructure/super-agent/rhel.yml +++ b/recipes/newrelic/infrastructure/super-agent/rhel.yml @@ -267,12 +267,14 @@ install: - | # Remove old config location (to deprecate) rm -f /etc/newrelic-super-agent/nrdot-values.yaml + # Create nr_otel_collector sub-agent dir + mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml else - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> //etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> //etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml fi config_supervisors: diff --git a/recipes/newrelic/infrastructure/super-agent/suse.yml b/recipes/newrelic/infrastructure/super-agent/suse.yml index 4377ba2b5..43613dd5e 100644 --- a/recipes/newrelic/infrastructure/super-agent/suse.yml +++ b/recipes/newrelic/infrastructure/super-agent/suse.yml @@ -220,12 +220,16 @@ install: sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf fi - | + # Remove old config location (to deprecate) + rm -f /etc/newrelic-super-agent/nrdot-values.yaml + # Create nr_otel_collector sub-agent dir + mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml else - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/agents.d/nr_otel_collector/values.yml + echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml fi config_supervisors: