2020-10-06 01:16:09 +00:00
|
|
|
#!/bin/bash -e
|
2023-03-28 22:48:58 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-10-06 01:16:09 +00:00
|
|
|
|
|
|
|
##Move datadog files
|
|
|
|
mv /home/ubuntu/scripts/conf.yaml /etc/datadog-agent/conf.d/consul.d/
|
|
|
|
mv /home/ubuntu/scripts/datadog.yaml /etc/datadog-agent/
|
|
|
|
|
|
|
|
##Move Consul Config that hooks up to datadog
|
2020-12-11 19:11:14 +00:00
|
|
|
mkdir -p /opt/consul/config
|
2020-10-06 01:16:09 +00:00
|
|
|
mv /home/ubuntu/scripts/telemetry.json /opt/consul/config/
|
|
|
|
|
|
|
|
## Let everyone own their stuff now
|
|
|
|
chown dd-agent:dd-agent /etc/datadog-agent/conf.d/consul.d/conf.yaml
|
|
|
|
chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml
|
|
|
|
|
|
|
|
## Put the key in the datadog.yaml
|
|
|
|
sed -i "s/api_key:.*/api_key: ${DD_API_KEY}/" /etc/datadog-agent/datadog.yaml
|