From 95b73daa36b23565a8566f71f9b202d3459b685f Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 25 Jun 2023 09:52:36 -0400 Subject: Initial Commit --- .../prometheus/node_exporter/tasks/main.yml | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 roles/services/monitoring/prometheus/node_exporter/tasks/main.yml (limited to 'roles/services/monitoring/prometheus/node_exporter/tasks') diff --git a/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml b/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml new file mode 100644 index 0000000..6bbcc08 --- /dev/null +++ b/roles/services/monitoring/prometheus/node_exporter/tasks/main.yml @@ -0,0 +1,28 @@ +- name: install package (Debian) + when: ansible_facts['distribution'] == "Debian" + package: + name: "{{ node_exporter_debian_package }}" + +- name: install package (Fedora) + when: ansible_facts['distribution'] == "Fedora" + package: + name: "{{ node_exporter_fedora_package }}" + +- name: allow port + ufw: + rule: allow + direction: in + proto: tcp + src: "{{ prometheus_server_ip }}" + to_port: "{{ node_exporter_port }}" + +- name: enable service + systemd: + name: prometheus-node-exporter + enabled: yes + masked: no + +- name: restart service + service: + name: prometheus-node-exporter + state: restarted -- cgit v1.2.3