1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-22 19:36:59 +02:00

Compare commits

...

7 commits

Author SHA1 Message Date
s3lph
28ba191c8d Fix typos and formatting issues 2020-11-18 00:36:11 +01:00
s3lph
b171046f4c Fix tls_config fields 2020-11-18 00:04:08 +01:00
s3lph
cc4692b37d Add support for tls_config in prometheus scrape configs 2020-11-17 23:56:43 +01:00
s3lph
5086fe389f Move PNE TLS config to a different directory 2020-11-17 23:17:49 +01:00
s3lph
c7d0bece62 Restart PNE when changing TLS config 2020-11-17 23:06:32 +01:00
s3lph
ee169d0b73 Fix TLS config ownership 2020-11-17 21:28:04 +01:00
s3lph
ad6a46af11 Dont require ca to reside on localhost 2020-11-17 21:27:30 +01:00
4 changed files with 24 additions and 4 deletions

View file

@ -1,6 +1,6 @@
---
- hosts: localhost
- hosts: cas
roles:
- s3lph.pki.pki_ca
@ -8,6 +8,7 @@
strategy: free
roles:
- s3lph.pki.pki_entity
- s3lph.prometheus.prometheus_node
- hosts: all_nodes
strategy: free
@ -26,4 +27,5 @@
- hosts: prometheus
roles:
- s3lph.pki.pki_entity
- s3lph.prometheus.prometheus

View file

@ -31,6 +31,14 @@
password: {{ job.basic_auth_password }}
{% endif -%}
{% if 'tls_config' in job -%}
tls_config:
ca_file: {{ job.tls_config.ca_file }}
cert_file: {{ job.tls_config.cert_file }}
key_file: {{ job.tls_config.key_file }}
insecure_skip_verify: {{ job.tls_config.insecure_skip_verify | default(false) }}
{% endif -%}
static_configs:
- targets:
{% for host in groups['all'] -%}

View file

@ -1,9 +1,19 @@
---
- name: render /etc/prometheus/tls/config.yml
- name: create /etc/prometheus/node-exporter/tls
file:
path: /etc/prometheus/node-exporter/tls
state: directory
owner: prometheus
group: prometheus
- name: render /etc/prometheus/node-exporter/tls/config.yml
template:
src: prometheus-node-exporter-webconfig.yml.j2
dest: /etc/prometheus/tls/config.yml
dest: /etc/prometheus/node-exporter/tls/config.yml
owner: prometheus
group: prometheus
notify: restart prometheus-node-exporter
- name: render /etc/default/prometheus-node-exporter
template:

View file

@ -1,3 +1,3 @@
{{ ansible_managed | comment }}
ARGS="{% for k, v in args.items() %}--{{ k }}=\"{{ v }}\" {% endfor %} --web.config=/etc/prometheus/tls/config.yml"
ARGS="{% for k, v in args.items() %}--{{ k }}=\"{{ v }}\" {% endfor %} --web.config=/etc/prometheus/node-exporter/tls/config.yml"