- backup role emits last-success/run metrics into node_exporter's textfile collector
- node_exporter enables systemd and textfile collectors
- prometheus deploys BackupStale/BackupTimerSilent/SystemdUnitFailed alert rules
- grafana gains Backups - Restic and Systemd dashboards
- fix prometheus.yml params rendering (quote values so {job=...} stays a string)
36 lines
853 B
YAML
36 lines
853 B
YAML
---
|
|
- name: Load OS-specific variables
|
|
ansible.builtin.include_vars: "{{ item }}"
|
|
with_first_found:
|
|
- "{{ ansible_facts['os_family'] }}.yml"
|
|
- "debian.yml"
|
|
|
|
- name: Install node_exporter
|
|
ansible.builtin.package:
|
|
name: "{{ node_exporter_package }}"
|
|
state: present
|
|
|
|
- name: Create textfile collector directory
|
|
ansible.builtin.file:
|
|
path: "{{ node_exporter_textfile_dir }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
|
|
- name: Deploy node_exporter configuration
|
|
ansible.builtin.template:
|
|
src: env.conf.j2
|
|
dest: "{{ node_exporter_args_file }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Restart node_exporter
|
|
|
|
- name: Enable and start node_exporter
|
|
ansible.builtin.systemd:
|
|
name: "{{ node_exporter_service }}"
|
|
enabled: true
|
|
state: started
|
|
daemon_reload: true
|