diff --git a/datadog/config.sls b/datadog/config.sls index 87db55b..c99079e 100644 --- a/datadog/config.sls +++ b/datadog/config.sls @@ -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: