mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 11:53:12 +00:00
9f9bd6830f
* Fix systemd_exporter vars to match the exporter flags --------- Signed-off-by: Jeremy Miller <runofthemill@users.noreply.github.com> Signed-off-by: prombot <prometheus-team@googlegroups.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: prombot <prometheus-team@googlegroups.com> Co-authored-by: SuperQ <SuperQ@users.noreply.github.com>
47 lines
1.3 KiB
Django/Jinja
47 lines
1.3 KiB
Django/Jinja
{{ ansible_managed | comment }}
|
|
|
|
[Unit]
|
|
Description=Prometheus SystemD Exporter
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User={{ systemd_exporter_system_user }}
|
|
Group={{ systemd_exporter_system_group }}
|
|
ExecStart={{ systemd_exporter_binary_install_dir }}/systemd_exporter \
|
|
{% if systemd_exporter_enable_restart_count %}
|
|
--systemd.collector.enable-restart-count \
|
|
{% endif %}
|
|
{% if systemd_exporter_enable_file_descriptor_size %}
|
|
--systemd.collector.enable-file-descriptor-size \
|
|
{% endif %}
|
|
{% if systemd_exporter_enable_ip_accounting %}
|
|
--systemd.collector.enable-ip-accounting \
|
|
{% endif %}
|
|
{% if systemd_exporter_unit_include != ""%}
|
|
--systemd.collector.unit-include={{ systemd_exporter_unit_include }} \
|
|
{% endif %}
|
|
{% if systemd_exporter_unit_exclude != "" %}
|
|
--systemd.collector.unit-exclude={{ systemd_exporter_unit_exclude }} \
|
|
{% endif %}
|
|
--web.listen-address={{ systemd_exporter_web_listen_address }}
|
|
|
|
SyslogIdentifier=systemd_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
|
|
{% else %}
|
|
ProtectSystem=full
|
|
{% endif %}
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|