mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 03:43:09 +00:00
a3f317588d
Signed-off-by: gardar <gardar@users.noreply.github.com>
40 lines
1 KiB
Django/Jinja
40 lines
1 KiB
Django/Jinja
{{ ansible_managed | comment }}
|
|
|
|
[Unit]
|
|
Description=Prometheus fail2ban_exporter
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User={{ fail2ban_exporter_system_user }}
|
|
Group={{ fail2ban_exporter_system_group }}
|
|
ExecStart={{ fail2ban_exporter_binary_install_dir }}/fail2ban_exporter \
|
|
--web.listen-address={{ fail2ban_exporter_web_listen_address }} \
|
|
{% if fail2ban_exporter_username | length > 0 -%}
|
|
--web.basic-auth.username={{ fail2ban_exporter_username }}
|
|
{% endif %}
|
|
{% if fail2ban_exporter_password | length > 0 -%}
|
|
--web.basic-auth.password={{ fail2ban_exporter_password }}
|
|
{% endif %}
|
|
--collector.f2b.socket={{ fail2ban_exporter_socket }}
|
|
|
|
|
|
SyslogIdentifier=fail2ban_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
|