Add the node_exporter role

This commit is contained in:
Alexander Gorelyshev
2025-12-17 12:26:46 +04:00
parent 87cf29448b
commit dce2de2145
12 changed files with 166 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
- name: Converge
hosts: all
roles:
- role: genlab.common.node_exporter
node_exporter_ver: "1.10.1"

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2404}-ansible:latest
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint .

View File

@@ -0,0 +1,15 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
tasks:
- name: "Sanity check the node exporter"
retries: 5
delay: 1
register: result
failed_when: '"node_exporter_build_info" not in result.content'
ansible.builtin.uri:
url: "http://localhost:9100/metrics"
return_content: true