ansible-infra/roles/common/tasks/node_exporter.yml

33 lines
923 B
YAML
Raw Normal View History

2020-04-13 14:46:45 +02:00
---
# Install and configure node-exporter
- name: Include role for installing node-exporter
include_role:
name: cloudalchemy.node-exporter
public: yes
vars:
2020-11-28 20:47:30 +01:00
node_exporter_web_listen_address: "localhost:{{ node_exporter_port }}"
2020-04-13 14:46:45 +02:00
- name: Configure Nginx for node-exporter
import_role:
name: nginx
vars:
nginx_config_file: node-exporter.conf
nginx_server:
name: "{{ inventory_hostname }}"
port: "{{ node_exporter_public_port }}"
locations:
- path: "{{ node_exporter_path }}"
basic_auth:
file: .htpasswd.node-exporter
password: "{{ node_exporter_password }}"
proxy_pass:
port: "{{ node_exporter_port }}"
path: /metrics
- name: Allow node-exporter port {{ node_exporter_public_port }}
ufw:
rule: allow
port: "{{ node_exporter_public_port }}"
2020-11-28 20:47:30 +01:00
- name: Trigger node-exporter handlers
meta: flush_handlers