From 9ee05c8b0a3d41aeb170285880e19af7812494ce Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Wed, 11 Jan 2023 20:12:37 -0800 Subject: fix datadog --- jinwei.me/config/roles/debian_init/tasks/main.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jinwei.me/config/roles/debian_init/tasks/main.yaml b/jinwei.me/config/roles/debian_init/tasks/main.yaml index a8d45d7..c6d88c3 100644 --- a/jinwei.me/config/roles/debian_init/tasks/main.yaml +++ b/jinwei.me/config/roles/debian_init/tasks/main.yaml @@ -94,5 +94,13 @@ become: true - name: Install Datadog - command: - DD_API_KEY={{ lookup('aws_ssm', '/jinwei-me/datadog/api_key') }} DD_SITE="datadoghq.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)" + shell: | + export DD_API_KEY={{ lookup('aws_ssm', '/jinwei-me/datadog/api_key') }} && \ + export DD_SITE="datadoghq.com" && \ + bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)" + +- name: enable datadog service + systemd: + name: datadog-agent + enabled: true + daemon_reload: true -- cgit v1.2.3