1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-22 01:31:01 +01:00

Add mTLS support for OpenBSD hosts

This commit is contained in:
s3lph 2020-11-18 02:12:27 +01:00
parent 8e4614c623
commit 600fbc8d1f
3 changed files with 34 additions and 9 deletions

View file

@ -0,0 +1,28 @@
---
- name: create /etc/prometheus/node-exporter/tls
file:
path: /etc/prometheus/node-exporter/tls
state: directory
owner: _nodeexporter
group: _nodeexporter
- name: render /etc/prometheus/node-exporter/tls/config.yml
template:
src: prometheus-node-exporter-webconfig.yml.j2
dest: /etc/prometheus/node-exporter/tls/config.yml
owner: _nodeexporter
group: _nodeexporter
notify: restart node exporter
- name: configure node exporter
lineinfile:
path: /etc/rc.conf.local
line: >-
node_exporter_flags=--collector.textfile.directory={{ node_exporter_textfile_dir }}
{{ node_exporter_flags }}
--web.config=/etc/prometheus/node-exporter/tls/config.yml
regexp: ^node_exporter_flags=.*$
notify:
- start node exporter
- restart node exporter

View file

@ -11,12 +11,3 @@
owner: root
group: _nodeexporter
mode: 0750
- name: enable node exporter
lineinfile:
path: /etc/rc.conf.local
line: "node_exporter_flags=--collector.textfile.directory={{ node_exporter_textfile_dir }} {{ node_exporter_flags }}"
regexp: ^node_exporter_flags=.*$
notify:
- start node exporter
- restart node exporter

View file

@ -11,3 +11,9 @@
tags:
- 'role::prometheus_node_openbsd'
- 'role::prometheus_node_openbsd:syspatch'
- name: configure prometheus node exporter
import_tasks: config.yml
tags:
- "role::prometheus_node"
- "role::prometheus_node:config"