mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-11-22 17:51:01 +01:00
Add mTLS support for OpenBSD hosts
This commit is contained in:
parent
8e4614c623
commit
600fbc8d1f
3 changed files with 34 additions and 9 deletions
28
roles/prometheus_node_openbsd/tasks/config.yml
Normal file
28
roles/prometheus_node_openbsd/tasks/config.yml
Normal 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
|
|
@ -11,12 +11,3 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: _nodeexporter
|
group: _nodeexporter
|
||||||
mode: 0750
|
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
|
|
||||||
|
|
|
@ -11,3 +11,9 @@
|
||||||
tags:
|
tags:
|
||||||
- 'role::prometheus_node_openbsd'
|
- 'role::prometheus_node_openbsd'
|
||||||
- 'role::prometheus_node_openbsd:syspatch'
|
- 'role::prometheus_node_openbsd:syspatch'
|
||||||
|
|
||||||
|
- name: configure prometheus node exporter
|
||||||
|
import_tasks: config.yml
|
||||||
|
tags:
|
||||||
|
- "role::prometheus_node"
|
||||||
|
- "role::prometheus_node:config"
|
||||||
|
|
Loading…
Reference in a new issue