2018-12-06 02:59:47 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create prometheus directories
|
|
|
|
ansible.builtin.file:
|
2018-12-06 02:59:47 +08:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ prometheus_user_id }}"
|
2020-11-26 01:00:38 +08:00
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0755"
|
2018-12-06 02:59:47 +08:00
|
|
|
with_items:
|
2024-02-14 18:14:02 +08:00
|
|
|
- "{{ prometheus_conf_dir }}"
|
|
|
|
- "{{ prometheus_data_dir }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Write prometheus config file
|
2022-01-13 23:57:50 +08:00
|
|
|
openstack.config_template.config_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 }}"
|
2020-11-26 01:00:38 +08:00
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0640"
|
2020-12-12 02:07:04 +08:00
|
|
|
config_type: yaml
|
|
|
|
config_overrides: "{{ prometheus_conf_overrides }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
notify: Service handler
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Make sure the alerting rules directory exists
|
|
|
|
ansible.builtin.file:
|
2019-02-16 03:27:15 +08:00
|
|
|
path: "/etc/prometheus/alerting/"
|
|
|
|
state: directory
|
2020-11-26 01:00:38 +08:00
|
|
|
owner: "{{ prometheus_user_id }}"
|
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0755"
|
2019-02-16 03:27:15 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy alerting rules
|
|
|
|
ansible.builtin.copy:
|
2019-02-16 03:27:15 +08:00
|
|
|
src: "ceph_dashboard.yml"
|
|
|
|
dest: "/etc/prometheus/alerting/ceph_dashboard.yml"
|
2020-11-26 01:00:38 +08:00
|
|
|
owner: "{{ prometheus_user_id }}"
|
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0644"
|
2019-02-16 03:27:15 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create alertmanager directories
|
|
|
|
ansible.builtin.file:
|
2018-12-06 02:59:47 +08:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2020-11-26 01:00:38 +08:00
|
|
|
owner: "{{ prometheus_user_id }}"
|
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0755"
|
2018-12-06 02:59:47 +08:00
|
|
|
with_items:
|
2024-02-14 18:14:02 +08:00
|
|
|
- "{{ alertmanager_conf_dir }}"
|
|
|
|
- "{{ alertmanager_data_dir }}"
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Write alertmanager config file
|
2022-01-13 23:57:50 +08:00
|
|
|
openstack.config_template.config_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"
|
2020-08-18 22:41:42 +08:00
|
|
|
owner: "{{ prometheus_user_id }}"
|
2020-11-26 01:00:38 +08:00
|
|
|
group: "{{ prometheus_user_id }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
mode: "0640"
|
2020-12-12 02:07:04 +08:00
|
|
|
config_type: yaml
|
|
|
|
config_overrides: "{{ alertmanager_conf_overrides }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
notify: Service handler
|
2018-12-06 02:59:47 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include setup_container.yml
|
|
|
|
ansible.builtin.include_tasks: setup_container.yml
|