From 694526beb5fdc6d2769bc1742f95a098dca18fdd Mon Sep 17 00:00:00 2001 From: alvarocabanas Date: Wed, 26 Jun 2024 15:04:19 +0200 Subject: [PATCH 1/4] Modify super-agent's infra-agent config to use the new flag is_integrations_only. --- recipes/newrelic/infrastructure/super-agent/debian.yml | 4 ++-- recipes/newrelic/infrastructure/super-agent/rhel.yml | 4 ++-- recipes/newrelic/infrastructure/super-agent/suse.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index c49e7c303..5147cdd25 100644 --- a/recipes/newrelic/infrastructure/super-agent/debian.yml +++ b/recipes/newrelic/infrastructure/super-agent/debian.yml @@ -183,7 +183,7 @@ install: sed -i "/^license_key/d" /etc/newrelic-infra.yml sed -i '/^custom_attributes:/,/^\S/{ /^\S/!d }' /etc/newrelic-infra.yml sed -i '/^custom_attributes:/d' /etc/newrelic-infra.yml - sed -i "/^is_secure_forward_only/d" /etc/newrelic-infra.yml + sed -i "/^is_integrations_only/d" /etc/newrelic-infra.yml if [ "{{.NR_SA_MIGRATE_INFRA_CONFIG}}" == "true" ] || [ "{{.NEW_RELIC_ASSUME_YES}}" == "true" ] ; then touch /etc/newrelic-infra-do-migrate @@ -430,7 +430,7 @@ install: cmds: - | if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" = "otel" ]; then - echo 'is_secure_forward_only: true' >> /etc/newrelic-infra.yml + echo 'is_integrations_only: true' >> /etc/newrelic-infra.yml mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values cp /etc/newrelic-super-agent/examples/values-nr-otel-collector-agent-linux-0.1.0.yaml /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml else diff --git a/recipes/newrelic/infrastructure/super-agent/rhel.yml b/recipes/newrelic/infrastructure/super-agent/rhel.yml index 165052256..05d8438d9 100644 --- a/recipes/newrelic/infrastructure/super-agent/rhel.yml +++ b/recipes/newrelic/infrastructure/super-agent/rhel.yml @@ -196,7 +196,7 @@ install: sed -i "/^license_key/d" /etc/newrelic-infra.yml sed -i '/^custom_attributes:/,/^\S/{ /^\S/!d }' /etc/newrelic-infra.yml sed -i '/^custom_attributes:/d' /etc/newrelic-infra.yml - sed -i "/^is_secure_forward_only/d" /etc/newrelic-infra.yml + sed -i "/^is_integrations_only/d" /etc/newrelic-infra.yml if [ "{{.NR_SA_MIGRATE_INFRA_CONFIG}}" == "true" ] || [ "{{.NEW_RELIC_ASSUME_YES}}" == "true" ] ; then touch /etc/newrelic-infra-do-migrate @@ -371,7 +371,7 @@ install: cmds: - | if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" = "otel" ]; then - echo 'is_secure_forward_only: true' >> /etc/newrelic-infra.yml + echo 'is_integrations_only: true' >> /etc/newrelic-infra.yml mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values cp /etc/newrelic-super-agent/examples/values-nr-otel-collector-agent-linux-0.1.0.yaml /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml else diff --git a/recipes/newrelic/infrastructure/super-agent/suse.yml b/recipes/newrelic/infrastructure/super-agent/suse.yml index df29dc29a..afaca259b 100644 --- a/recipes/newrelic/infrastructure/super-agent/suse.yml +++ b/recipes/newrelic/infrastructure/super-agent/suse.yml @@ -155,7 +155,7 @@ install: sed -i "/^license_key/d" /etc/newrelic-infra.yml sed -i '/^custom_attributes:/,/^\S/{ /^\S/!d }' /etc/newrelic-infra.yml sed -i '/^custom_attributes:/d' /etc/newrelic-infra.yml - sed -i "/^is_secure_forward_only/d" /etc/newrelic-infra.yml + sed -i "/^is_integrations_only/d" /etc/newrelic-infra.yml if [ "{{.NR_SA_MIGRATE_INFRA_CONFIG}}" == "true" ] || [ "{{.NEW_RELIC_ASSUME_YES}}" == "true" ] ; then touch /etc/newrelic-infra-do-migrate @@ -321,7 +321,7 @@ install: cmds: - | if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" = "otel" ]; then - echo 'is_secure_forward_only: true' >> /etc/newrelic-infra.yml + echo 'is_integrations_only: true' >> /etc/newrelic-infra.yml mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values cp /etc/newrelic-super-agent/examples/values-nr-otel-collector-agent-linux-0.1.0.yaml /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml else From 5ffa528818de3f6a15f491a06a66e5859d7b858b Mon Sep 17 00:00:00 2001 From: NSSPKrishna Date: Thu, 27 Jun 2024 12:28:36 +0530 Subject: [PATCH 2/4] chore: Correcting the debian flow of super agent --- recipes/newrelic/infrastructure/super-agent/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index 5147cdd25..de06e9a71 100644 --- a/recipes/newrelic/infrastructure/super-agent/debian.yml +++ b/recipes/newrelic/infrastructure/super-agent/debian.yml @@ -217,7 +217,7 @@ install: setup_infra_proxy: cmds: - | - if [ "{{.NR_CLI_INFRA_AGENT}}" != "false"] && [ ! -z "$HTTPS_PROXY" ]; then + if [ "{{.NR_CLI_INFRA_AGENT}}" != "false" ] && [ ! -z "$HTTPS_PROXY" ]; then sed -i "/^proxy/d" /etc/newrelic-infra.yml echo 'proxy: {{.HTTPS_PROXY}}' >> /etc/newrelic-infra.yml fi From 7e23b0c619f7552dd74c6c80155ec47da3e07000 Mon Sep 17 00:00:00 2001 From: NSSPKrishna Date: Thu, 27 Jun 2024 12:28:36 +0530 Subject: [PATCH 3/4] chore: Correcting the debian flow of super agent From 7ad2a92d5efaa43bd6b0f22d899569e73e375e3c Mon Sep 17 00:00:00 2001 From: NSSPKrishna Date: Thu, 27 Jun 2024 15:32:40 +0530 Subject: [PATCH 4/4] chore: Fixing the centos 8 --- .../super-agent/rhel/centos8-super-agent.json | 9 +++++++++ .../super-agent/rhel/centos8arm64-super-agent.json | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/test/definitions/super-agent/rhel/centos8-super-agent.json b/test/definitions/super-agent/rhel/centos8-super-agent.json index beb778b14..38323b04f 100644 --- a/test/definitions/super-agent/rhel/centos8-super-agent.json +++ b/test/definitions/super-agent/rhel/centos8-super-agent.json @@ -17,6 +17,15 @@ "instrumentations": { "resources": [ + { + "id": "nr_infra_setup", + "resource_ids": ["host1"], + "source_repository": "https://github.com/newrelic/open-install-library.git", + "deploy_script_path": "test/deploy/linux/shell/roles", + "params": { + "step_prepare": "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i '|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" + } + }, { "id": "nr_super_agent", "resource_ids": ["host1"], diff --git a/test/definitions/super-agent/rhel/centos8arm64-super-agent.json b/test/definitions/super-agent/rhel/centos8arm64-super-agent.json index dfd0463b3..5ffef39eb 100644 --- a/test/definitions/super-agent/rhel/centos8arm64-super-agent.json +++ b/test/definitions/super-agent/rhel/centos8arm64-super-agent.json @@ -17,6 +17,15 @@ "instrumentations": { "resources": [ + { + "id": "nr_infra_setup", + "resource_ids": ["host1"], + "source_repository": "https://github.com/newrelic/open-install-library.git", + "deploy_script_path": "test/deploy/linux/shell/roles", + "params": { + "step_prepare": "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i '|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*" + } + }, { "id": "nr_super_agent", "resource_ids": ["host1"],