Skip to content

Commit

Permalink
Remove old check config file if check is installed with Agent 6/7 (#47)
Browse files Browse the repository at this point in the history
Remove conf.d/<check>.yaml if a check is enabled and Agent 6/7 is installed, preventing config file duplication.
  • Loading branch information
KSerrania authored Jan 13, 2020
1 parent 928830b commit 5597db4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datadog/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ datadog_yaml_installed:
{% for check_name in datadog_checks %}
{%- if latest_agent_version or parsed_version[1] != '5' %}
# Make sure the check directory is present
datadog_{{ check_name }}_folder_installed:
file.directory:
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.d
- user: dd-agent
- group: root
- mode: 700
# Remove the old config file (if it exists)
datadog_{{ check_name }}_old_yaml_removed:
file.absent:
- name: {{ datadog_install_settings.confd_path }}/{{ check_name }}.yaml
{%- endif %}
datadog_{{ check_name }}_yaml_installed:
Expand Down

0 comments on commit 5597db4

Please sign in to comment.