add prometheus node exporters and agent

This commit is contained in:
Pim Kunis 2023-07-23 16:58:00 +02:00
parent 7aee24efff
commit 0c7ee6b1bc
6 changed files with 74 additions and 1 deletions
ansible/roles/prometheus_agent/tasks

View file

@ -0,0 +1,21 @@
- name: Create prometheus directory
file:
path: /root/prometheus
state: directory
- name: Copy prometheus config
copy:
src: "{{ role_path }}/prometheus.yml"
dest: /root/prometheus/prometheus.yml
- name: Copy prometheus systemd unit
copy:
src: "{{ role_path }}/container-prometheus.service"
dest: /etc/systemd/system/container-prometheus.service
notify: systemd daemon reload
- name: Enable prometheus systemd unit
systemd:
name: container-prometheus.service
enabled: true
state: started