nginx_exporter First version of role
This commit is contained in:
parent
1952f5f96e
commit
92ca4fcba4
5 changed files with 125 additions and 0 deletions
23
roles/nginx_exporter/templates/nginx_exporter.service.j2
Normal file
23
roles/nginx_exporter/templates/nginx_exporter.service.j2
Normal file
|
@ -0,0 +1,23 @@
|
|||
[Unit]
|
||||
Description=Prometheus NGINX Exporter
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nginx_exporter
|
||||
Group=nginx_exporter
|
||||
#Environment="SCRAPE_URI={% for host in groups['proxy'] -%}https://{{ host }}/stub_status {% endfor %}"
|
||||
ExecStart=/usr/local/bin/nginx_exporter \
|
||||
--web.config.file=/etc/nginx_exporter/web-config.yml \
|
||||
{% for host in groups['proxy'] %}
|
||||
--nginx.scrape-uri=https://{{ host }}/stub_status \
|
||||
{% endfor %}
|
||||
--nginx.ssl-ca-cert={{ tls_certs }}/ca.crt \
|
||||
--nginx.ssl-client-cert={{ tls_certs }}/{{ inventory_hostname }}.crt \
|
||||
--nginx.ssl-client-key={{ tls_private }}/{{ inventory_hostname }}.key
|
||||
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue