prometheus/tasks/server/grafana-prometheus.yml

64 lines
1.7 KiB
YAML
Raw Normal View History

2021-04-29 18:53:56 +02:00
---
2022-11-14 10:58:21 +01:00
- name: 'prometheus | server | assert | check mandatory vars are defined'
2021-05-25 18:25:22 +02:00
assert:
that:
- "prometheus_server_monitor is defined"
2021-04-29 18:53:56 +02:00
2021-05-25 18:25:22 +02:00
- name: 'prometheus | server | create prometheus directory to /etc'
2021-04-29 18:53:56 +02:00
file:
path: /etc/prometheus
state: directory
mode: '0755'
2021-05-25 18:25:22 +02:00
- name: 'prometheus | server | copy config prometheus yml'
2021-04-29 18:53:56 +02:00
template:
src: conf/prometheus.yml.j2
2021-04-29 18:53:56 +02:00
dest: /etc/prometheus/prometheus.yml
owner: root
group: root
mode: 0644
2021-05-26 12:06:05 +02:00
notify:
2023-02-10 11:13:37 +01:00
- 'grafana-prometheus-restart'
2021-04-29 18:53:56 +02:00
2023-02-09 18:01:15 +01:00
- name: "grafana-prometheus | create docker-compose directory"
file:
path: /opt/docker-compose/grafana-prometheus
state: directory
mode: '0755'
- name: "grafana-prometheus | copy docker-compose file"
template:
src: compose/grafana-prometheus.yml.j2
dest: /opt/docker-compose/grafana-prometheus/docker-compose.yml
owner: root
group: root
mode: 0644
2023-02-10 11:13:37 +01:00
notify: "grafana-prometheus-restart"
2023-02-09 18:01:15 +01:00
- name: "grafana-prometheus | create grafana.ini file"
2023-07-24 14:32:59 +02:00
template:
src: conf/grafani.ini.j2
dest: /opt/docker-compose/grafana-prometheus/grafana.ini
2023-02-09 18:01:15 +01:00
owner: '1000'
group: '1000'
mode: '0750'
2023-02-10 11:13:37 +01:00
notify: "grafana-prometheus-restart"
2023-02-09 18:01:15 +01:00
ignore_errors: '{{ ansible_check_mode }}'
- name: "grafana-prometheus | install unit file to systemd"
vars:
exporter: "grafana-prometheus"
template:
src: systemd/docker-compose.service.j2
dest: /etc/systemd/system/docker-compose@grafana-prometheus.service
owner: root
group: root
mode: 0600
- name: "grafana-prometheus | enable service"
systemd:
daemon_reload: yes
name: docker-compose@grafana-prometheus
enabled: true
ignore_errors: '{{ ansible_check_mode }}'