diff --git a/roles/smartctl_exporter/templates/smartctl_exporter.service.j2 b/roles/smartctl_exporter/templates/smartctl_exporter.service.j2 index 105262206..9c7e573d5 100644 --- a/roles/smartctl_exporter/templates/smartctl_exporter.service.j2 +++ b/roles/smartctl_exporter/templates/smartctl_exporter.service.j2 @@ -33,6 +33,11 @@ StartLimitInterval=0 ProtectHome=yes NoNewPrivileges=yes +{% if (ansible_facts.packages.systemd | first).version is version('229', '>=') %} +AmbientCapabilities=CAP_SYS_RAWIO CAP_DAC_READ_SEARCH +CapabilityBoundingSet=CAP_SYS_RAWIO CAP_DAC_READ_SEARCH +{% endif %} + {% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %} ProtectSystem=strict ProtectControlGroups=true