add mSSL support for the prometheus server

monitoring
histausse 3 years ago
parent 569c9df319
commit 5a3268dc37
Signed by: histausse
GPG Key ID: 67486F107F62E9E9

@ -37,7 +37,7 @@
group: prometheus
key_mode: u=rw,g=,o=
subject_alt_name: "IP:{{ lan_address }}"
notify: Restart prometheus-node-exporter
# Need an equivalent to notify here
- name: Copy the CA cert
copy:

@ -19,6 +19,24 @@
owner: prometheus
mode: u=rwx,g=rx,o=rx
- name: Generate certificate
include_role:
name: generate-cert
vars:
directory: /etc/prometheus/
cname: "prometheus-{{ lan_address }}"
owner: prometheus
group: prometheus
key_mode: u=rw,g=,o=
subject_alt_name: "IP:{{ lan_address }}"
# Need an equivalent to notify here
- name: Copy the CA cert
copy:
content: "{{ ca_cert }}"
dest: /etc/prometheus/ca.crt
notify: Restart prometheus
- name: Setup the prometheus config
template:
src: prometheus.yml

@ -45,3 +45,8 @@ scrape_configs:
- source_labels: [__param_target]
target_label: __address__
replacement: '$1:9100'
scheme: https
tls_config:
ca_file: '/etc/prometheus/ca.crt'
cert_file: '/etc/prometheus/prometheus-{{ lan_address }}.crt'
key_file: '/etc/prometheus/prometheus-{{ lan_address }}.key'

Loading…
Cancel
Save