integrated agent role
This commit is contained in:
parent
688b134522
commit
c677a02fde
4 changed files with 62 additions and 0 deletions
|
|
@ -1,3 +1,42 @@
|
|||
- name: install prometheus
|
||||
apt:
|
||||
pkg: prometheus
|
||||
|
||||
- name: update prometheus user
|
||||
user:
|
||||
name: prometheus
|
||||
groups: ssl-cert
|
||||
append: yes
|
||||
|
||||
- name: wrtie prometheus (base) config
|
||||
copy:
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
dest: /etc/prometheus/conf.d/prometheus.yml
|
||||
content: "{{ prometheus.config|to_nice_yaml }}"
|
||||
|
||||
- name: create ssl certificate folder
|
||||
file:
|
||||
dest: /etc/prometheus/targetcerts/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
|
||||
- name: create config folders
|
||||
file:
|
||||
dest: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
loop:
|
||||
- /etc/prometheus/conf.d
|
||||
- /etc/prometheus/conf.d/scrape_configs
|
||||
|
||||
- name: add cronjob to regenerate config
|
||||
cron:
|
||||
name: regenerate prometheus config
|
||||
minute: 3,18,33,48
|
||||
job: cat /etc/prometheus/conf.d/* /etc/prometheus/conf.d/scrape_configs/* 2> /dev/null > /etc/prometheus/prometheus.yml; /usr/sbin/service prometheus reload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue