prometheus/tasks/server/grafana-provisioning.yml
2023-07-20 10:04:33 +02:00

285 lines
9.2 KiB
YAML

- name: "grafana-prometheus | import grafana provisioned datasources"
synchronize:
src: "{{ grafana_provisioned_datasources_path }}"
dest: /opt/docker-compose/grafana-prometheus/
when: grafana_provisioned_datasources_path is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana provisioned dashboards"
synchronize:
src: "{{ grafana_provisioned_dashboards_path }}"
dest: /opt/docker-compose/grafana-prometheus/
when: grafana_provisioned_datasources_path is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | create grafana provisioning directories"
file:
path: "/opt/docker-compose/grafana-prometheus/{{ item }}"
state: directory
owner: '1000'
group: '1000'
mode: '0755'
loop:
- datasources
- dashboards
when: grafana_provisioned_datasources_path is not defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana provisioned datasources conf"
copy:
src: dashboards/datasources.yaml
dest: /opt/docker-compose/grafana-prometheus/datasources/datasources.yaml
owner: '1000'
group: '1000'
mode: '0750'
when: grafana_provisioned_datasources_path is not defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana provisioned dashboards conf"
copy:
src: dashboards/dashboard.yaml
dest: /opt/docker-compose/grafana-prometheus/dashboards/dashboard.yaml
owner: '1000'
group: '1000'
mode: '0750'
when: grafana_provisioned_dashboards_path is not defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana apache dashboard"
copy:
src: dashboards/apache.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/apache.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_apache_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana cloudflare dashboard"
copy:
src: dashboards/cloudflare.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/cloudflare.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_cloudflare_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana docker dashboard"
copy:
src: dashboards/docker.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/docker.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_docker_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana docker dashboard"
copy:
src: dashboards/docker.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/docker.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_cadvisor_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana opensearch dashboard"
copy:
src: dashboards/opensearch.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/opensearch.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_opensearch_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana haproxy dashboard"
copy:
src: dashboards/haproxy.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/haproxy.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_haproxy_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana memcached dashboard"
copy:
src: dashboards/memcached.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/memcached.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_memcached_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana mysqld dashboard"
copy:
src: dashboards/mysqld.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/mysqld.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_mysqld_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana network dashboard"
copy:
src: dashboards/network.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/network.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_node_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana node-exporter dashboard"
copy:
src: dashboards/node-exporter.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/node-exporter.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_node_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana opcache dashboard"
copy:
src: dashboards/opcache.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/opcache.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_opcache_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana overview dashboard"
copy:
src: dashboards/overview.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/overview.json
owner: '1000'
group: '1000'
mode: '0750'
when: >
prometheus_node_exporter_targets is defined and
prometheus_cloudflare_exporter_targets is not defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana overview-cf dashboard"
copy:
src: dashboards/overview-cf.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/overview.json
owner: '1000'
group: '1000'
mode: '0750'
when: >
prometheus_node_exporter_targets is defined and
prometheus_cloudflare_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana plateform-overview dashboard"
copy:
src: dashboards/plateform-overview.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/plateform-overview.json
owner: '1000'
group: '1000'
mode: '0750'
when: >
prometheus_node_exporter_targets is defined and
prometheus_cloudflare_exporter_targets is not defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana plateform-overview-cf dashboard"
copy:
src: dashboards/plateform-overview-cf.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/plateform-overview.json
owner: '1000'
group: '1000'
mode: '0750'
when: >
prometheus_node_exporter_targets is defined and
prometheus_cloudflare_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana phpfpm dashboard"
copy:
src: dashboards/phpfpm.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/phpfpm.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_phpfpm_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana proxmox dashboard"
copy:
src: dashboards/proxmox.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/proxmox.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_proxmox_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana redis dashboard"
copy:
src: dashboards/redis.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/redis.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_redis_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana varnish dashboard"
copy:
src: dashboards/varnish.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/varnish.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_varnish_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana gitlab dashboard"
copy:
src: dashboards/gitlab.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/gitlab.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_gitlab_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana postgresql dashboard"
copy:
src: dashboards/postgresql.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/postgresql.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_postgres_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana kong dashboard"
copy:
src: dashboards/kong.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/kong.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_kong_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana nginx dashboard"
copy:
src: dashboards/nginx.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/nginx.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_nginx_exporter_targets is defined
notify: "grafana-prometheus-restart"