mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 06:14:13 +00:00
c9df5e56b4
Signed-off-by: gardar <gardar@users.noreply.github.com>
42 lines
1.2 KiB
Django/Jinja
42 lines
1.2 KiB
Django/Jinja
{{ ansible_managed | comment }}
|
|
|
|
[Unit]
|
|
Description=Prometheus nginx_exporter
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User={{ nginx_exporter_system_user }}
|
|
Group={{ nginx_exporter_system_group }}
|
|
ExecStart={{ nginx_exporter_binary_install_dir }}/nginx-prometheus-exporter \
|
|
'--nginx.scrape-uri={{ nginx_exporter_scrape_uri }}' \
|
|
'--web.listen-address={{ nginx_exporter_web_listen_address }}' \
|
|
'--web.telemetry-path={{ nginx_exporter_web_telemetry_path }}' \
|
|
{% if nginx_exporter_tls_server_config | length > 0 or nginx_exporter_http_server_config | length > 0 or nginx_exporter_basic_auth_users | length > 0 %}
|
|
'--web.config.file={{ nginx_exporter_config_dir }}/web_config.yml' \
|
|
{% endif %}
|
|
{% if nginx_exporter_plus %}
|
|
'--nginx.plus' \
|
|
{% endif %}
|
|
'--log.level={{ nginx_exporter_log_level }}' \
|
|
'--log.format={{ nginx_exporter_log_format }}'
|
|
|
|
SyslogIdentifier=nginx_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
|