ansible-collection-prometheus/roles/smokeping_prober/templates/smokeping_prober.service.j2
Christian Krause 09f705ad00
enhancement(smokeping_prober): allows using multiple web listen addresses
Signed-off-by: Christian Krause <christian.krause@idiv.de>
2023-11-30 11:12:11 +01:00

51 lines
1.4 KiB
Django/Jinja

{{ ansible_managed | comment }}
[Unit]
Description=Smokeping Prober
After=network-online.target
StartLimitInterval=0
StartLimitIntervalSec=0
[Service]
Type=simple
User={{ smokeping_prober_system_user }}
Group={{ smokeping_prober_system_group }}
PermissionsStartOnly=true
ExecReload=/bin/kill -HUP $MAINPID
ExecStart={{ smokeping_prober_binary_install_dir }}/smokeping_prober \
--config.file={{ smokeping_prober_config_dir }}//{{ smokeping_prober_config_file }} \
{% if smokeping_prober_version is version('0.7.0', '>=') and
smokeping_prober_web_listen_address is iterable and
smokeping_prober_web_listen_address is not mapping and
smokeping_prober_web_listen_address is not string %}
{% for address in smokeping_prober_web_listen_address %}
--web.listen-address={{ address }}{{ " \\" if not loop.last else "" }}
{% endfor %}
{% else %}
--web.listen-address={{ smokeping_prober_web_listen_address }}
{% endif %}
SyslogIdentifier=smokeping_prober
KillMode=process
Restart=always
RestartSec=5
LockPersonality=true
NoNewPrivileges=true
MemoryDenyWriteExecute=true
PrivateTmp=true
ProtectHome=true
RemoveIPC=true
RestrictSUIDSGID=true
AmbientCapabilities=CAP_NET_RAW
{% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %}
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=yes
ProtectSystem=strict
{% else %}
ProtectSystem=full
{% endif %}
[Install]
WantedBy=multi-user.target