From 30ee715264b0a288e972ea9b0d0a40291b98e460 Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 14 Apr 2022 20:43:10 -0700 Subject: [PATCH] + Setting up Grafana service (metrics.lablad) + Reverse proxy entry for nginx routing This is the first step for establishing a goal for the server's logging stack --- docker-host/setup/files/files.lablad | 6 +----- docker-host/setup/files/metrics.lablad | 10 ++++++++++ docker-host/setup/tasks/grafana.yml | 26 ++++++++++++++++++++++++++ docker-host/setup/tasks/nginx.yml | 2 ++ docker-host/setup/vars/main.yml | 1 + 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 docker-host/setup/files/metrics.lablad create mode 100644 docker-host/setup/tasks/grafana.yml diff --git a/docker-host/setup/files/files.lablad b/docker-host/setup/files/files.lablad index 1e149f7..c2aa632 100644 --- a/docker-host/setup/files/files.lablad +++ b/docker-host/setup/files/files.lablad @@ -1,10 +1,6 @@ -# this file pertains to the gitea service which is served under the fqdn: -# git.lablad -# the default port is listed under /vars/main.yml as 3000 as gitea_pub_port - server { server_name files.lablad; location / { proxy_pass http://127.0.0.1:8080; } -} \ No newline at end of file +} diff --git a/docker-host/setup/files/metrics.lablad b/docker-host/setup/files/metrics.lablad new file mode 100644 index 0000000..d920446 --- /dev/null +++ b/docker-host/setup/files/metrics.lablad @@ -0,0 +1,10 @@ +# metrics.lablad + +server { + server_name metrics.lablad; + proxy_set_header Host $http_host; + location / { + proxy_pass http://127.0.0.1:6000; + } +} + diff --git a/docker-host/setup/tasks/grafana.yml b/docker-host/setup/tasks/grafana.yml new file mode 100644 index 0000000..2e390fc --- /dev/null +++ b/docker-host/setup/tasks/grafana.yml @@ -0,0 +1,26 @@ +--- +- hosts: leftcoastlab + become: yes + tasks: + - name: Include Vars + include_vars: + dir: ../vars + + - name: Create Grafana Volume + community.docker.docker_volume: + name: grafana-volume + + - name: Setup Grafana Container(latest) + community.docker.docker_container: + name: grafana + image: grafana/grafana-oss:latest + pull: yes + restart_policy: always + recreate: yes + timeout: 120 + ports: + - "{{GRAFANA_PORT}}:3000" + volumes: + - "grafana-volume:/var/lib/grafana/" + + diff --git a/docker-host/setup/tasks/nginx.yml b/docker-host/setup/tasks/nginx.yml index d25f3a3..ab4e599 100644 --- a/docker-host/setup/tasks/nginx.yml +++ b/docker-host/setup/tasks/nginx.yml @@ -43,6 +43,7 @@ - ../files/git.lablad - ../files/music.lablad - ../files/files.lablad + - ../files/metrics.lablad - name: Enable Sites file: @@ -53,6 +54,7 @@ - git.lablad - music.lablad - files.lablad + - metrics.lablad notify: - restart-nginx diff --git a/docker-host/setup/vars/main.yml b/docker-host/setup/vars/main.yml index c4638e1..074a17f 100644 --- a/docker-host/setup/vars/main.yml +++ b/docker-host/setup/vars/main.yml @@ -4,3 +4,4 @@ DEBIAN_CODENAME: sid GITEA_PUB_PORT: 3000 GITEA_SSH_PORT: 2222 FILEBROWSER_PORT: 8080 +GRAFANA_PORT: 6000