Skip to content

Commit

Permalink
[backport] Remove old check config file if check is installed with Ag…
Browse files Browse the repository at this point in the history
…ent 6/7 (#47)
  • Loading branch information
KSerrania committed Jul 10, 2020
1 parent 3b075c5 commit 82d3e51
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 @@ -55,12 +55,18 @@ datadog-conf-python-version:
{% for check_name in datadog_settings.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_settings.checks_confd }}/{{ check_name }}.d
- user: dd-agent
- group: root
- mode: 600
# Remove the old config file (if it exists)
datadog_{{ check_name }}_old_yaml_removed:
file.absent:
- name: {{ datadog_settings.checks_confd }}/{{ check_name }}.yaml
{%- endif %}
datadog_{{ check_name }}_yaml_installed:
Expand Down

0 comments on commit 82d3e51

Please sign in to comment.