Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure datadog is in good state, fix swap file path check #465

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading