Add prometheus role
Configured to include job definitions from /etc/prometheus/conf.d/*.yml.
This commit is contained in:
parent
f33a0b8a21
commit
d347fd7215
4 changed files with 31 additions and 0 deletions
21
roles/prometheus/tasks/main.yml
Normal file
21
roles/prometheus/tasks/main.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
- prometheus
|
||||
|
||||
- name: Create directory for prometheus configs
|
||||
file:
|
||||
path: /etc/prometheus/conf.d
|
||||
state: directory
|
||||
|
||||
- name: Configure prometheus
|
||||
copy:
|
||||
dest: /etc/prometheus/
|
||||
src: prometheus.yml
|
||||
notify: reload prometheus
|
||||
|
||||
- name: Enable prometheus service
|
||||
service:
|
||||
name: prometheus
|
||||
enabled: true
|
||||
state: started
|
Loading…
Add table
Add a link
Reference in a new issue