2018-12-06 02:59:47 +08:00
|
|
|
---
|
|
|
|
- name: create prometheus directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ prometheus_user_id }}"
|
|
|
|
with_items:
|
|
|
|
- "{{ prometheus_conf_dir }}"
|
|
|
|
- "{{ prometheus_data_dir }}"
|
|
|
|
|
|
|
|
- name: write prometheus config file
|
|
|
|
template:
|
2019-05-13 22:21:16 +08:00
|
|
|
src: prometheus.yml.j2
|
2019-05-21 22:29:16 +08:00
|
|
|
dest: "{{ prometheus_conf_dir }}/prometheus.yml"
|
2018-12-06 02:59:47 +08:00
|
|
|
owner: "{{ prometheus_user_id }}"
|
|
|
|
notify: service handler
|
|
|
|
|
2019-02-16 03:27:15 +08:00
|
|
|
- name: make sure the alerting rules directory exists
|
|
|
|
file:
|
|
|
|
path: "/etc/prometheus/alerting/"
|
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
|
|
|
|
- name: copy alerting rules
|
|
|
|
copy:
|
|
|
|
src: "ceph_dashboard.yml"
|
|
|
|
dest: "/etc/prometheus/alerting/ceph_dashboard.yml"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
|
2018-12-06 02:59:47 +08:00
|
|
|
- name: create alertmanager directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "root"
|
|
|
|
with_items:
|
|
|
|
- "{{ alertmanager_conf_dir }}"
|
|
|
|
- "{{ alertmanager_data_dir }}"
|
|
|
|
|
|
|
|
- name: write alertmanager config file
|
|
|
|
template:
|
2019-05-13 22:21:16 +08:00
|
|
|
src: alertmanager.yml.j2
|
2019-05-21 22:29:16 +08:00
|
|
|
dest: "{{ alertmanager_conf_dir }}/alertmanager.yml"
|
2018-12-06 02:59:47 +08:00
|
|
|
owner: "root"
|
|
|
|
notify: service handler
|
|
|
|
|
|
|
|
- name: include setup_container.yml
|
|
|
|
include_tasks: setup_container.yml
|