Skip to content

Commit

Permalink
fix: ensure datadog is in good state, fix swap file path check (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee authored Aug 14, 2024
1 parent 8112059 commit 9c6eb1a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion salt/datadog/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,25 @@ datadog_repo:
- source: salt://datadog/files
{% if 'datadog_api_key' in pillar %}
check_datadog_installation:
cmd.run:
- name: |
if ! dpkg-query -W datadog-agent || ! test -f /etc/datadog-agent/datadog.yaml; then
dpkg --remove --force-remove-reinstreq datadog-agent || true
apt-get -y --fix-broken install
apt-get update
fi
- hide_output: True
datadog-agent:
pkg:
- installed
- require:
- pkgrepo: datadog_repo
- mount: {% if swap_path %}{{ swap_path }}{% endif %}
{% if swap_path %}
- mount: {{ swap_path }}
{% endif %}
- cmd: check_datadog_installation
service:
- running
- enable: True
Expand Down

0 comments on commit 9c6eb1a

Please sign in to comment.