setup datadog agent on each host.

- set agent version to 7
This commit is contained in:
2022-01-22 14:59:15 -05:00
parent 449eb42c36
commit f723e4ac2e
61 changed files with 3661 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
---
- name: restart datadog-agent-sysprobe
service:
name: datadog-agent-sysprobe
state: restarted
when: datadog_enabled and datadog_sysprobe_enabled and not ansible_check_mode and not ansible_facts.os_family == "Windows"
- name: restart datadog-agent
service:
name: datadog-agent
state: restarted
when: datadog_enabled and not ansible_check_mode and not ansible_facts.os_family == "Windows"
# We can't add the Windows Agent service restart handler directly here because that makes the role require
# the ansible.windows collection on all platforms. We only want it to be needed on Windows.
# Therefore, what we do is the following: when needed, our Windows tasks call this handler to require a
# Windows Agent restart (through notify: restart datadog-agent-win).
# When notified, the below handler is executed at the end of the playbook run.
# The include_tasks loads the handlers/main-win.yml file, which contains the real service restart task
# (which depends on ansible.windows), and runs it, triggering the Windows Agent restart.
- name: restart datadog-agent-win
include_tasks: handlers/main-win.yml