diff options
-rw-r--r-- | chaos-at-home/ch-mon.yml | 18 | ||||
-rw-r--r-- | dan/ele-calypso.yml | 14 | ||||
-rw-r--r-- | inventory/host_vars/ch-mon.yml | 5 | ||||
-rw-r--r-- | inventory/host_vars/ele-calypso.yml | 5 | ||||
-rw-r--r-- | roles/monitoring/landingpage/defaults/main.yml | 7 | ||||
-rw-r--r-- | roles/monitoring/landingpage/tasks/main.yml | 29 | ||||
-rw-r--r-- | roles/monitoring/landingpage/templates/index.html.j2 | 17 |
7 files changed, 69 insertions, 26 deletions
diff --git a/chaos-at-home/ch-mon.yml b/chaos-at-home/ch-mon.yml index 46c0b928..df34e09d 100644 --- a/chaos-at-home/ch-mon.yml +++ b/chaos-at-home/ch-mon.yml @@ -7,6 +7,10 @@ - role: core/sshd/base - role: core/zsh - role: core/ntp + +- name: Payload Setup + hosts: ch-mon + roles: - role: storage/lvm/groups - role: nginx/base - role: apt-repo/spreadspace @@ -15,16 +19,4 @@ - role: monitoring/prometheus/server - role: monitoring/prometheus/alertmanager - role: monitoring/grafana - - role: nginx/vhost - nginx_vhost: - name: monitoring - template: generic - hostnames: - - "_" - locations: - '/grafana/': - proxy_pass: "http://127.0.0.1:3000" - '/prometheus/': - proxy_pass: "http://127.0.0.1:9090" - '/alertmanager/': - proxy_pass: "http://127.0.0.1:9093" + - role: monitoring/landingpage diff --git a/dan/ele-calypso.yml b/dan/ele-calypso.yml index 818e8f3a..106a73d0 100644 --- a/dan/ele-calypso.yml +++ b/dan/ele-calypso.yml @@ -24,19 +24,7 @@ - role: monitoring/prometheus/server - role: monitoring/prometheus/alertmanager - role: monitoring/grafana - - role: nginx/vhost - nginx_vhost: - name: monitoring - template: generic - hostnames: - - "_" - locations: - '/grafana/': - proxy_pass: "http://127.0.0.1:3000" - '/prometheus/': - proxy_pass: "http://127.0.0.1:9090" - '/alertmanager/': - proxy_pass: "http://127.0.0.1:9093" + - role: monitoring/landingpage post_tasks: ## TODO: move to network/interfaces when this is done - name: install vlan interfaces diff --git a/inventory/host_vars/ch-mon.yml b/inventory/host_vars/ch-mon.yml index c6ec6901..94de793b 100644 --- a/inventory/host_vars/ch-mon.yml +++ b/inventory/host_vars/ch-mon.yml @@ -215,3 +215,8 @@ grafana_dashboards: datasource: "Prometheus" - file: bind datasource: "Prometheus" + + +monitoring_landingpage_hostnames: + - "mon.chaos-at-home.org" +monitoring_landingpage_title: "chaos@home Monitoring Host" diff --git a/inventory/host_vars/ele-calypso.yml b/inventory/host_vars/ele-calypso.yml index b4627d94..8c874408 100644 --- a/inventory/host_vars/ele-calypso.yml +++ b/inventory/host_vars/ele-calypso.yml @@ -170,6 +170,11 @@ grafana_dashboards: datasource: "Prometheus" +monitoring_landingpage_hostnames: + - "_" +monitoring_landingpage_title: "Elevate Festival Monitoring Host" + + sachet_providers: smstools: outgoing_dir: /var/spool/sms/outgoing 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 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>{{ monitoring_landingpage_title }} - {{ host_name }}.{{ host_domain }}</title> + <meta charset="utf-8"> + </head> + <body style="padding-top: 5em; background-color: #eee; font-family: sans;"> + <div style="text-align:center; margin-left:auto; margin-right:auto;"> + <h1>{{ monitoring_landingpage_title }}</h1> + <ul> + <li><a target='_blank' href='/prometheus/'>Prometheus</a></li> + <li><a target='_blank' href='/alertmanager/'>Prometheus Alertmanager</a></li> + <li><a target='_blank' href='/grafana/'>Grafana</a></li> + </ul> + </div> + </body> +</html> |