Skip to content

Commit

Permalink
Use config examples to set up the super-agent, allowing to have empty…
Browse files Browse the repository at this point in the history
… agents. (#1054)
  • Loading branch information
alvarocabanas authored Mar 7, 2024
1 parent ee0261f commit 51aafc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
8 changes: 2 additions & 6 deletions recipes/newrelic/infrastructure/super-agent/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,11 @@ install:
config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ]; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
cp /etc/newrelic-super-agent/examples/super-agent-config-no-agents.yaml /etc/newrelic-super-agent/config.yaml
else
sed -i 's/s*#\s*agents:/agents:/g' /etc/newrelic-super-agent/config.yaml
cp /etc/newrelic-super-agent/examples/super-agent-config-all-agents.yaml /etc/newrelic-super-agent/config.yaml
fi
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ]; then
Expand Down
10 changes: 3 additions & 7 deletions recipes/newrelic/infrastructure/super-agent/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,10 @@ install:
config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ]; then
cp /etc/newrelic-super-agent/examples/super-agent-config-no-agents.yaml /etc/newrelic-super-agent/config.yaml
else
sed -i 's/s*#\s*agents:/agents:/g' /etc/newrelic-super-agent/config.yaml
cp /etc/newrelic-super-agent/examples/super-agent-config-all-agents.yaml /etc/newrelic-super-agent/config.yaml
fi
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] ; then
Expand Down
10 changes: 3 additions & 7 deletions recipes/newrelic/infrastructure/super-agent/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,10 @@ install:
config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ]; then
cp /etc/newrelic-super-agent/examples/super-agent-config-no-agents.yaml /etc/newrelic-super-agent/config.yaml
else
sed -i 's/s*#\s*agents:/agents:/g' /etc/newrelic-super-agent/config.yaml
cp /etc/newrelic-super-agent/examples/super-agent-config-all-agents.yaml /etc/newrelic-super-agent/config.yaml
fi
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] ; then
Expand Down

0 comments on commit 51aafc4

Please sign in to comment.