From 00508f3dbbfb5fabee409598891d64e45dadf7b2 Mon Sep 17 00:00:00 2001 From: Erik Zenker Date: Sun, 14 Feb 2021 15:52:13 +0100 Subject: [PATCH 1/3] Add install prometheus playbook --- README.md | 10 ++++++++++ environments/production/inventory.yml | 2 ++ playbooks/install_prometheus.yml | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 playbooks/install_prometheus.yml diff --git a/README.md b/README.md index 5daba5b..1a34659 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,18 @@ ## Requirements +### General - ansible (prefer newer ansible versions which are python 3 compatible) +### Prometheus +- jmespath (installing host) +- unzip (target host) + ## Deployment Instructions +### Prometheus +- `ansible-galaxy install cloudalchemy.prometheus` +- `ansible-playbook -i environments/production/inventory.yml playbooks/install_prometheus.yml` + +### Signal tower - Copy `ansible.cfg.example` to `ansible.cfg` - `ansible-playbook -i environments/production/inventory.yml playbooks/install_signaltower.yml` diff --git a/environments/production/inventory.yml b/environments/production/inventory.yml index 9396cc8..e384736 100644 --- a/environments/production/inventory.yml +++ b/environments/production/inventory.yml @@ -1,5 +1,7 @@ --- all: + vars: + prometheus_version: 2.22.0 hosts: 185.189.221.157: null diff --git a/playbooks/install_prometheus.yml b/playbooks/install_prometheus.yml new file mode 100644 index 0000000..3b964fc --- /dev/null +++ b/playbooks/install_prometheus.yml @@ -0,0 +1,7 @@ + +- hosts: all + strategy: debug + remote_user: root + become: yes + roles: + - cloudalchemy.prometheus \ No newline at end of file From a9d951ac711040a010974a3155e5774ffd29cdd6 Mon Sep 17 00:00:00 2001 From: Erik Zenker Date: Sun, 14 Feb 2021 17:07:40 +0100 Subject: [PATCH 2/3] Add install grafana playbook --- README.md | 9 ++++++++- environments/production/inventory.yml | 25 +++++++++++++++++++++++++ playbooks/install_grafana.yml | 7 +++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 playbooks/install_grafana.yml diff --git a/README.md b/README.md index 1a34659..837547e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,18 @@ - ansible (prefer newer ansible versions which are python 3 compatible) ### Prometheus -- jmespath (installing host) +- jmespath (deployer host) - unzip (target host) +### Grafana +- jmespath (deployer host) + ## Deployment Instructions +### Grafana +- `ansible-galaxy install cloudalchemy.grafana` +- `ansible-playbook -i environments/production/inventory.yml playbooks/install_grafana.yml` + ### Prometheus - `ansible-galaxy install cloudalchemy.prometheus` - `ansible-playbook -i environments/production/inventory.yml playbooks/install_prometheus.yml` diff --git a/environments/production/inventory.yml b/environments/production/inventory.yml index e384736..57f5a22 100644 --- a/environments/production/inventory.yml +++ b/environments/production/inventory.yml @@ -2,6 +2,31 @@ all: vars: + # Prometheus vars prometheus_version: 2.22.0 + + prometheus_web_listen_address: '0.0.0.0:9090' + + prometheus_scrape_jobs: + - job_name: 'signal-tower' + metrics_path: /metrics + params: + module: [http_2xx] + static_configs: + - targets: + - localhost:4233 + + # Grafana vars + grafana_security: + admin_user: admin + admin_password: "admin" + + grafana_datasources: + - name: prometheus + type: prometheus + access: proxy + url: 'http://{{ prometheus_web_listen_address }}' + basicAuth: false + hosts: 185.189.221.157: null diff --git a/playbooks/install_grafana.yml b/playbooks/install_grafana.yml new file mode 100644 index 0000000..a69391d --- /dev/null +++ b/playbooks/install_grafana.yml @@ -0,0 +1,7 @@ + +- hosts: all + strategy: debug + remote_user: root + become: yes + roles: + - cloudalchemy.grafana \ No newline at end of file From ab4a3b7baa7238ebc8f30d8387a746e21be29ee4 Mon Sep 17 00:00:00 2001 From: Erik Zenker Date: Sun, 14 Mar 2021 15:01:36 +0100 Subject: [PATCH 3/3] Move prometheus/grafana configuration into group vars --- environments/production/inventory.yml | 27 -------------------- environments/staging/group_vars/all/main.yml | 24 ++++++++++++++++- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/environments/production/inventory.yml b/environments/production/inventory.yml index 57f5a22..9396cc8 100644 --- a/environments/production/inventory.yml +++ b/environments/production/inventory.yml @@ -1,32 +1,5 @@ --- all: - vars: - # Prometheus vars - prometheus_version: 2.22.0 - - prometheus_web_listen_address: '0.0.0.0:9090' - - prometheus_scrape_jobs: - - job_name: 'signal-tower' - metrics_path: /metrics - params: - module: [http_2xx] - static_configs: - - targets: - - localhost:4233 - - # Grafana vars - grafana_security: - admin_user: admin - admin_password: "admin" - - grafana_datasources: - - name: prometheus - type: prometheus - access: proxy - url: 'http://{{ prometheus_web_listen_address }}' - basicAuth: false - hosts: 185.189.221.157: null diff --git a/environments/staging/group_vars/all/main.yml b/environments/staging/group_vars/all/main.yml index 7f84da2..cda51ad 100644 --- a/environments/staging/group_vars/all/main.yml +++ b/environments/staging/group_vars/all/main.yml @@ -4,4 +4,26 @@ palava_signaltower_install_dir: /srv/signaltower-staging palava_signaltower_log_dir: /var/log/signaltower-staging palava_environment: staging -palava_signaltower_autostart: no \ No newline at end of file +palava_signaltower_autostart: no + +# Prometheus vars +prometheus_version: 2.22.0 +prometheus_web_listen_address: '127.0.0.1:9090' +prometheus_scrape_jobs: +- job_name: 'signal-tower' + metrics_path: /metrics + params: + module: [http_2xx] + static_configs: + - targets: + - localhost:4233 +# Grafana vars +grafana_security: + admin_user: admin + admin_password: "admin" +grafana_datasources: + - name: prometheus + type: prometheus + access: proxy + url: 'http://{{ prometheus_web_listen_address }}' + basicAuth: false