Skip to content

Commit 5e00811

Browse files
authored
feat(ohi): add super-agent as infra-agent substitute dependency for OHIs (#997)
1 parent 28a8e27 commit 5e00811

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

docs/recipe-spec/recipe-spec.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ repository: string, required
4040
# ex:
4141
# dependencies:
4242
# - infrastructure-agent-installer
43+
#
44+
# A special 'OR' variant for recipe dependencies involves the infrastructure and super agents. It allows the super-agent
45+
# to be used as an alternative recipe dependency instead of the infrastructure-agent-installer when the super-agent is a targeted install:
46+
# ex:
47+
# dependencies:
48+
# - infrastructure-agent-installer || super-agent
4349
dependencies: list, optional
4450

4551
# Still TBD

recipes/newrelic/infrastructure/ohi/mysql/debian.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: New Relic install recipe for default MySQL Open Source on-host inte
77
repository: https://github.com/newrelic/nri-mysql
88

99
dependencies:
10-
- infrastructure-agent-installer
10+
- infrastructure-agent-installer || super-agent
1111

1212
installTargets:
1313
- type: host
@@ -77,14 +77,14 @@ install:
7777
- task: input_assert
7878
vars:
7979
MAX_RETRIES: 3
80-
- task: restart
8180

8281
assert_infra:
8382
cmds:
8483
- |
8584
IS_INFRA_INSTALLED=$(sudo ps aux | grep newrelic-infra-service | grep -v grep | wc -l)
86-
if [ $IS_INFRA_INSTALLED -eq 0 ] ; then
87-
echo "The infrastructure agent is required to install this integration, we recommend going through our guided install path for this pre-requisite which can be found here: https://docs.newrelic.com/docs/full-stack-observability/observe-everything/get-started/new-relic-guided-install-overview" >&2
85+
IS_SUPER_AGENT_INSTALLED=$(sudo ps aux | grep newrelic-super-agent | grep -v grep | wc -l)
86+
if [ $IS_INFRA_INSTALLED -eq 0 ] && [ $IS_SUPER_AGENT_INSTALLED -eq 0 ] ; then
87+
echo "The infrastructure agent or the super agent is required to install this integration. We recommend going through our guided install path for this pre-requisite which can be found at: https://docs.newrelic.com/docs/full-stack-observability/observe-everything/get-started/new-relic-guided-install-overview" >&2
8888
exit 1
8989
fi
9090
@@ -265,24 +265,6 @@ install:
265265
interval: 30
266266
EOT
267267
268-
restart:
269-
cmds:
270-
- |
271-
if [ {{.IS_SYSTEMCTL}} -gt 0 ]; then
272-
sudo systemctl restart newrelic-infra
273-
else
274-
if [ {{.IS_INITCTL}} -gt 0 ]; then
275-
sudo initctl restart newrelic-infra
276-
else
277-
sudo /etc/init.d/newrelic-infra restart
278-
fi
279-
fi
280-
vars:
281-
IS_SYSTEMCTL:
282-
sh: command -v systemctl | wc -l
283-
IS_INITCTL:
284-
sh: command -v initctl | wc -l
285-
286268
collect_meta:
287269
cmds:
288270
- |

0 commit comments

Comments
 (0)