diff --git a/templates/node_exporter.service.j2 b/templates/node_exporter.service.j2 index b8ff96e..3dfd4eb 100644 --- a/templates/node_exporter.service.j2 +++ b/templates/node_exporter.service.j2 @@ -29,7 +29,11 @@ SyslogIdentifier=node_exporter Restart=always PrivateTmp=yes +{% for m in ansible_mounts if m.mount == '/home' %} +ProtectHome=read-only +{% else %} ProtectHome=yes +{% endfor %} NoNewPrivileges=yes {% if node_exporter_systemd_version | int >= 232 %}