fix: do not use namespace in node exporter systemd template

This commit is contained in:
Craig Fielder 2024-06-26 22:11:39 -04:00
parent bec32d1d0c
commit 0d4c613bc7

View file

@ -50,14 +50,14 @@ Restart=always
RestartSec=1
StartLimitInterval=0
{% set ns = namespace(protect_home = 'yes') %}
{% set protect_home = 'yes' %}
{% for m in ansible_mounts if m.mount.startswith('/home') %}
{% set ns.protect_home = 'read-only' %}
{% set protect_home = 'read-only' %}
{% endfor %}
{% if node_exporter_textfile_dir.startswith('/home') %}
{% set ns.protect_home = 'read-only' %}
{% set protect_home = 'read-only' %}
{% endif %}
ProtectHome={{ ns.protect_home }}
ProtectHome={{ protect_home }}
NoNewPrivileges=yes
{% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %}