ansible-collection-prometheus/roles/ipmi_exporter/templates/ipmi_exporter.service.j2
gardar f09635db73
refactor(ipmi_exporter): delegate common tasks to _common role
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-10-15 17:05:25 +00:00

39 lines
1.1 KiB
Django/Jinja

{{ ansible_managed | comment }}
[Unit]
Description=Prometheus ipmi_exporter
After=network-online.target
[Service]
Type=simple
User={{ ipmi_exporter_system_user }}
Group={{ ipmi_exporter_system_group }}
ExecStart={{ ipmi_exporter_binary_install_dir }}/ipmi_exporter \
'--config.file={{ ipmi_exporter_config_dir }}/config.yaml' \
'--web.listen-address={{ ipmi_exporter_web_listen_address }}' \
{% if ipmi_exporter_tls_server_config | length > 0 or ipmi_exporter_http_server_config | length > 0 or ipmi_exporter_basic_auth_users | length > 0 %}
'--web.config.file={{ ipmi_exporter_config_dir }}/web_config.yml' \
{% endif %}
'--log.level={{ ipmi_exporter_log_level }}' \
'--log.format={{ ipmi_exporter_log_format }}'
SyslogIdentifier=ipmi_exporter
Restart=always
RestartSec=1
StartLimitInterval=0
ProtectHome=yes
NoNewPrivileges=yes
{% if (ansible_facts.packages.systemd | first).version is version('232', '>=') %}
ProtectSystem=strict
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=yes
PrivateTmp=true
{% else %}
ProtectSystem=full
{% endif %}
[Install]
WantedBy=multi-user.target