-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Agent6 (beta) support on debianoids (#81)
Flipping the attribute 'datadog_agent6' to true installs the agent6 instead of the agent5. Switching it back to false would reverse the operation as long as the agent 5 version is pinned.
- Loading branch information
1 parent
6b7583d
commit 3ba579e
Showing
7 changed files
with
150 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Create main Datadog agent configuration file | ||
template: | ||
src: datadog.conf.j2 | ||
dest: /etc/dd-agent/datadog.conf | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
notify: restart datadog-agent | ||
|
||
# DEPRECATED: Remove specific handling of the process check for next major release | ||
- name: Add process check configuration | ||
template: src=process.yaml.j2 dest=/etc/dd-agent/conf.d/process.yaml | ||
when: datadog_process_checks is defined | ||
notify: restart datadog-agent | ||
|
||
- debug: 'msg="[DEPRECATION NOTICE] Using `datadog_process_checks` is deprecated, use `process` under `datadog_checks` instead"' | ||
when: datadog_process_checks is defined | ||
|
||
- name: Ensure datadog-agent is running | ||
service: name=datadog-agent state=started enabled=yes | ||
when: datadog_enabled | ||
|
||
- name: Ensure datadog-agent is not running | ||
service: name=datadog-agent state=stopped enabled=no | ||
when: not datadog_enabled | ||
|
||
- name: Create a configuration file for each Datadog check | ||
template: | ||
src: checks.yaml.j2 | ||
dest: /etc/dd-agent/conf.d/{{ item }}.yaml | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
with_items: '{{ datadog_checks|list }}' | ||
notify: restart datadog-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
- name: Create main Datadog agant yaml configuration file (beta) | ||
template: | ||
src: datadog.yaml.j2 | ||
dest: /etc/datadog-agent/datadog.yaml | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
notify: restart datadog-agent | ||
|
||
- debug: 'msg="Using deprecated `datadog_process_checks` is no longer supported in agent6, use `process` under `datadog_checks` instead"' | ||
when: datadog_process_checks is defined | ||
|
||
- name: Create a configuration file for each Datadog check | ||
template: | ||
src: checks.yaml.j2 | ||
dest: "/etc/datadog-agent/conf.d/{{ item }}.yaml" | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
with_items: '{{ datadog_checks|list }}' | ||
notify: restart datadog-agent | ||
|
||
- name: Create trace agent configuration file | ||
template: | ||
src: datadog.conf.j2 | ||
dest: /etc/datadog-agent/trace-agent.conf | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
notify: restart datadog-agent | ||
|
||
- name: Create process agent configuration file | ||
template: | ||
src: datadog.conf.j2 | ||
dest: /etc/datadog-agent/process-agent.conf | ||
owner: '{{ datadog_user }}' | ||
group: '{{ datadog_group }}' | ||
notify: restart datadog-agent | ||
|
||
- name: Ensure datadog-agent is running | ||
service: name=datadog-agent state=started enabled=yes | ||
when: datadog_enabled | ||
|
||
- name: Ensure datadog-agent is not running | ||
service: name=datadog-agent state=stopped enabled=no | ||
when: not datadog_enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Managed by Ansible | ||
|
||
{% if datadog_config["dd_url"] is not defined -%} | ||
dd_url: {{ datadog_url | default('https://app.datadoghq.com') }} | ||
{% endif %} | ||
|
||
{% if datadog_config["api_key"] is not defined -%} | ||
api_key: {{ datadog_api_key | default('youshouldsetthis') }} | ||
{% endif %} | ||
|
||
{{ datadog_config | to_nice_yaml }} |