From 261bd7d6544189cc585adb1d8c6dbb4b2dfd6be3 Mon Sep 17 00:00:00 2001 From: c6ristian Date: Sun, 3 Nov 2024 21:23:27 +0100 Subject: [PATCH] Add prometheus-node-exporter role and add it to most hosts --- inventories/chaosknoten/hosts.yaml | 10 ++++++++++ playbooks/deploy.yaml | 5 +++++ .../configs/grafana/docker_compose/prometheus.yml | 11 +++++++++-- .../roles/prometheus_node_exporter/meta/main.yaml | 9 +++++++++ .../roles/prometheus_node_exporter/tasks/main.yaml | 14 ++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 playbooks/roles/prometheus_node_exporter/meta/main.yaml create mode 100644 playbooks/roles/prometheus_node_exporter/tasks/main.yaml diff --git a/inventories/chaosknoten/hosts.yaml b/inventories/chaosknoten/hosts.yaml index 06fb108..1302069 100644 --- a/inventories/chaosknoten/hosts.yaml +++ b/inventories/chaosknoten/hosts.yaml @@ -108,6 +108,16 @@ all: pretalx: wiki: zammad: + prometheus_node_exporter_hosts: + hosts: + ccchoir: + tickets: + keycloak: + onlyoffice: + pad: + pretalx: + wiki: + zammad: infrastructure_authorized_keys_hosts: hosts: ccchoir: diff --git a/playbooks/deploy.yaml b/playbooks/deploy.yaml index 27855f3..50e55dc 100644 --- a/playbooks/deploy.yaml +++ b/playbooks/deploy.yaml @@ -82,6 +82,11 @@ roles: - nginx +- name: Ensure prometheus_node_exporter deployment on prometheus_node_exporter_hosts + hosts: prometheus_node_exporter_hosts + roles: + - prometheus_node_exporter + - name: Configure unattended upgrades hosts: all become: true diff --git a/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml b/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml index 7936fd5..be244a6 100644 --- a/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml +++ b/playbooks/files/chaosknoten/configs/grafana/docker_compose/prometheus.yml @@ -98,9 +98,16 @@ scrape_configs: - woodpecker-intern.hamburg.ccc.de:9100 - penpot-intern.hamburg.ccc.de:9100 - jitsi.hamburg.ccc.de:9100 - # Wieske Physical Machines + - onlyoffice-intern.hamburg.ccc.de:9100 + - ccchoir-intern.hamburg.ccc.de:9100 + - tickets-intern.hamburg.ccc.de:9100 + - keycloak-intern.hamburg.ccc.de:9100 + - onlyoffice-intern.hamburg.ccc.de:9100 + - pad-intern.hamburg.ccc.de:9100 + - wiki-intern.hamburg.ccc.de:9100 + - zammad-intern.hamburg.ccc.de:9100 - labels: site: wieske type: physical_machine targets: - - chaosknoten.hamburg.ccc.de:9100 + - chaosknoten.hamburg.ccc.de:9100 \ No newline at end of file diff --git a/playbooks/roles/prometheus_node_exporter/meta/main.yaml b/playbooks/roles/prometheus_node_exporter/meta/main.yaml new file mode 100644 index 0000000..02b00ac --- /dev/null +++ b/playbooks/roles/prometheus_node_exporter/meta/main.yaml @@ -0,0 +1,9 @@ +--- +dependencies: + - role: distribution_check + vars: + distribution_check__distribution_support_spec: + - name: Debian + major_versions: + - "11" + - "12" diff --git a/playbooks/roles/prometheus_node_exporter/tasks/main.yaml b/playbooks/roles/prometheus_node_exporter/tasks/main.yaml new file mode 100644 index 0000000..c138f18 --- /dev/null +++ b/playbooks/roles/prometheus_node_exporter/tasks/main.yaml @@ -0,0 +1,14 @@ +- name: make sure the `prometheus-node-exporter` package is installed + ansible.builtin.apt: + name: prometheus-node-exporter + state: present + allow_change_held_packages: true + update_cache: true + become: true + +- name: make sure `prometheus-node-exporter.service` is started and ansibled + ansible.builtin.systemd: + name: prometheus-node-exporter.service + state: started + enabled: true + become: true