diff --git a/roles/metrics/files/grafana.env b/roles/metrics/files/grafana.env deleted file mode 100644 index 660b3fc..0000000 --- a/roles/metrics/files/grafana.env +++ /dev/null @@ -1,6 +0,0 @@ -GF_AUTH_ANONYMOUS_ENABLED=true -GF_AUTH_BASIC_ENABLED=false -GF_AUTH_PROXY_ENABLED=false -GF_USERS_ALLOW_SIGN_UP=false -GF_INSTALL_PLUGINS=grafana-piechart-panel -GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/ \ No newline at end of file diff --git a/roles/metrics/tasks/base.yml b/roles/metrics/tasks/base.yml index bffdc43..a1ece6e 100644 --- a/roles/metrics/tasks/base.yml +++ b/roles/metrics/tasks/base.yml @@ -5,12 +5,6 @@ path: metrics state: directory -- name: Copy metrics conf - ansible.builtin.copy: - src: . - dest: metrics/ - register: metrics_copy_files_results - - name: Copy template conf ansible.builtin.template: src: "{{ item.src }}" @@ -24,5 +18,5 @@ project_src: metrics state: present pull: true - restarted: "{{ metrics_copy_files_results.changed or metrics_copy_templates_results.changed }}" + restarted: "{{ metrics_copy_templates_results.changed }}" become: true \ No newline at end of file diff --git a/roles/metrics/templates/docker-compose.yml b/roles/metrics/templates/docker-compose.yml index f897d12..2fb9db9 100644 --- a/roles/metrics/templates/docker-compose.yml +++ b/roles/metrics/templates/docker-compose.yml @@ -31,6 +31,23 @@ services: - traefik.http.services.prometheus.loadbalancer.server.port=9090 - traefik.docker.network=proxy + loki: + image: grafana/loki:latest + command: -config.file=/etc/loki/config.yml + volumes: + - {{ server.work_dir }}/loki/config:/etc/loki + networks: + - metrics + + promtail: + image: grafana/promtail:latest + command: -config.file=/etc/promtail/config.yml + volumes: + - {{ server.work_dir }}/promtail/config:/etc/promtail + - /var/log:/var/log + networks: + - metrics + grafana: image: grafana/grafana:latest restart: unless-stopped @@ -40,8 +57,13 @@ services: - {{ server.work_dir }}/grafana/provisioning:/etc/grafana/provisioning - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - env_file: - - grafana.env + environment: + GF_AUTH_ANONYMOUS_ENABLED: "true" + GF_AUTH_BASIC_ENABLED: "false" + GF_AUTH_PROXY_ENABLED: "false" + GF_USERS_ALLOW_SIGN_UP: "false" + GF_INSTALL_PLUGINS: grafana-piechart-panel + GF_SERVER_ROOT_URL: "%(protocol)s://%(domain)s:%(http_port)s/" depends_on: - prometheus networks: