From 4d16bcd374f6fa830d1598a506d46b5b07aad857 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 7 Dec 2022 22:36:08 +0100 Subject: monitoring: add simple landingpage --- roles/monitoring/landingpage/defaults/main.yml | 7 ++++++ roles/monitoring/landingpage/tasks/main.yml | 29 ++++++++++++++++++++++ .../monitoring/landingpage/templates/index.html.j2 | 17 +++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 roles/monitoring/landingpage/defaults/main.yml create mode 100644 roles/monitoring/landingpage/tasks/main.yml create mode 100644 roles/monitoring/landingpage/templates/index.html.j2 (limited to 'roles/monitoring/landingpage') diff --git a/roles/monitoring/landingpage/defaults/main.yml b/roles/monitoring/landingpage/defaults/main.yml new file mode 100644 index 00000000..ad2a3895 --- /dev/null +++ b/roles/monitoring/landingpage/defaults/main.yml @@ -0,0 +1,7 @@ +--- +# monitoring_landingpage_hostnames: +# - "mon.example.com" + +monitoring_landingpage_acme: no + +#monitoring_landingpage_title: "Example Monitoring Host" diff --git a/roles/monitoring/landingpage/tasks/main.yml b/roles/monitoring/landingpage/tasks/main.yml new file mode 100644 index 00000000..3158770b --- /dev/null +++ b/roles/monitoring/landingpage/tasks/main.yml @@ -0,0 +1,29 @@ +--- +- name: create nginx document root directory + file: + path: "/var/www/landingpage" + state: directory + +- name: copy index.html + template: + src: index.html.j2 + dest: "/var/www/landingpage/index.html" + +- name: configure nginx vhost + vars: + nginx_vhost: + name: landingpage + template: generic + hostnames: "{{ monitoring_landingpage_hostnames }}" + acme: "{{ monitoring_landingpage_acme }}" + locations: + '/': + root: /var/www/landingpage + '/prometheus/': + proxy_pass: "http://{{ prometheus_server_web_listen_address | default('127.0.0.1:9090') }}" + '/alertmanager/': + proxy_pass: "http://{{ prometheus_alertmanager_web_listen_address | default('127.0.0.1:9093') }}" + '/grafana/': + proxy_pass: "http://{{ grafana_config_server.http_addr | default('localhost') }}:{{ grafana_config_server.http_port | default(3000) }}" + include_role: + name: nginx/vhost diff --git a/roles/monitoring/landingpage/templates/index.html.j2 b/roles/monitoring/landingpage/templates/index.html.j2 new file mode 100644 index 00000000..8972b0d5 --- /dev/null +++ b/roles/monitoring/landingpage/templates/index.html.j2 @@ -0,0 +1,17 @@ + + + + {{ monitoring_landingpage_title }} - {{ host_name }}.{{ host_domain }} + + + +
+

{{ monitoring_landingpage_title }}

+ +
+ + -- cgit v1.2.3