add prometheus node exporters and agent
This commit is contained in:
parent
7aee24efff
commit
0c7ee6b1bc
6 changed files with 74 additions and 1 deletions
ansible/roles/prometheus_agent/tasks
21
ansible/roles/prometheus_agent/tasks/main.yml
Normal file
21
ansible/roles/prometheus_agent/tasks/main.yml
Normal 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
|
Reference in a new issue