From 72cf4f794a44ff7fdbabb238461ee74be080c776 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Thu, 19 Sep 2024 00:14:05 -0400 Subject: [PATCH] add node_exporter --- playbook.yml | 8 +++++++- requirements.yml | 2 ++ roles/common/tasks/main.yml | 3 +++ roles/common/tasks/monitoring.yml | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 requirements.yml create mode 100644 roles/common/tasks/monitoring.yml diff --git a/playbook.yml b/playbook.yml index 28a5b0c..276924a 100644 --- a/playbook.yml +++ b/playbook.yml @@ -61,4 +61,10 @@ - hosts: cups roles: - - cups \ No newline at end of file + - cups + +# we want node metrics on the satisfactory server +- hosts: satisfactory + roles: + - docker + - prometheus.prometheus.node_exporter \ No newline at end of file diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..5791901 --- /dev/null +++ b/requirements.yml @@ -0,0 +1,2 @@ +collections: + - name: prometheus.prometheus \ No newline at end of file diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 454c409..f5fda68 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -35,6 +35,9 @@ include_tasks: user.yml with_dict: '{{ users }}' +- name: Configure monitoring + include_tasks: monitoring.yml + - name: Configure hostname hostname: name: '{{ inventory_hostname }}' diff --git a/roles/common/tasks/monitoring.yml b/roles/common/tasks/monitoring.yml new file mode 100644 index 0000000..bd9c9e3 --- /dev/null +++ b/roles/common/tasks/monitoring.yml @@ -0,0 +1,4 @@ +- name: Import prometheus node_exporter role + import_role: + name: prometheus.prometheus.node_exporter + when: ansible_virtualization_role == 'host'