From 691cdc4dd06691f4aea3c5908a09b47672888592 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Fri, 7 Jul 2023 12:06:43 +0000 Subject: [PATCH] feat: new async icinga --- group_vars/all.yaml | 18 ++++++++++++++++++ roles/docker-deployments/tasks/main.yaml | 10 ++++++++++ .../templates/async-config.json.j2 | 7 +++++++ .../templates/async-icinga-config.json.j2 | 2 +- .../templates/async-icinga.yaml | 2 +- vars/services.yaml | 2 ++ 6 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 roles/docker-deployments/templates/async-config.json.j2 diff --git a/group_vars/all.yaml b/group_vars/all.yaml index 21a9d8a..b78a150 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -7,6 +7,11 @@ nsca_password: HISTORY_PURGED_SECRET RSYSLOG_SERVER: internal.monitoring.atlantishq.de influxdb_telegraf_password: HISTORY_PURGED_SECRET +icinga_api_user: "mobile" +icinga_api_pass: "HISTORY_PURGED_SECRET" +icinga_api_url: "https://192.168.122.107:5665" +icinga_web_url: "https://icinga.atlantishq.de/" + ldap_password: flanigan ldap_dc: "atlantishq" ldap_org: "atlantishq de" @@ -185,3 +190,16 @@ keycloak_clients: groups: "monitoring" master_address: "https://stats.atlantishq.de" skips: + + async-icinga: + party_secret : "HISTORY_PURGED_SECRET" + client_id: z_async_icinga + client_secret: "HISTORY_PURGED_SECRET" + redirect_uris: + - "https://async-icinga.atlantishq.de/*" + description: "Icinga Web" + keycloak_id: "00000000-0000-0000-0000-000000000010" + groups: "monitoring,icinga" + master_address: "https://async-icinga.atlantishq.de" + skips: + - "/" diff --git a/roles/docker-deployments/tasks/main.yaml b/roles/docker-deployments/tasks/main.yaml index f654dd4..c883f72 100644 --- a/roles/docker-deployments/tasks/main.yaml +++ b/roles/docker-deployments/tasks/main.yaml @@ -18,6 +18,13 @@ name: /data/async-icinga state: directory +- name: Async Icinga Service (static) + template: + src: async-config.json.j2 + dest: /data/async-icinga/config.json + notify: + - reload async icinga settings + - name: Async Icinga Service (static) template: src: async-icinga-config.json.j2 @@ -141,6 +148,7 @@ - tmnf-replay-server - atlantis-hub - grafana + - async-icinga - name: include services ports include_vars: services.yaml @@ -153,6 +161,7 @@ - tmnf-replay-server - atlantis-hub - grafana + - async-icinga - name: Deploy OAuth2Proxy community.docker.docker_compose: @@ -162,3 +171,4 @@ - tmnf-replay-server - atlantis-hub - grafana + - async-icinga diff --git a/roles/docker-deployments/templates/async-config.json.j2 b/roles/docker-deployments/templates/async-config.json.j2 new file mode 100644 index 0000000..935c9d4 --- /dev/null +++ b/roles/docker-deployments/templates/async-config.json.j2 @@ -0,0 +1,7 @@ +{ + "ICINGA_API_USER" : "{{ icinga_api_user }}", + "ICINGA_API_PASS" : "{{ icinga_api_pass }}", + "ICINGA_API_URL" : "{{ icinga_api_url }}", + "ICINGA_WEB_URL" : "{{ icinga_web_url }}", + "ASYNC_ICINGA_DUMMY_HOST" : "ASYNC_ICINGA" +} diff --git a/roles/docker-deployments/templates/async-icinga-config.json.j2 b/roles/docker-deployments/templates/async-icinga-config.json.j2 index b1b521a..ae62b4a 100644 --- a/roles/docker-deployments/templates/async-icinga-config.json.j2 +++ b/roles/docker-deployments/templates/async-icinga-config.json.j2 @@ -2,7 +2,7 @@ {% for service in async_icinga_static_services %} "{{ service['name'] }}" : { "timeout" : "{{ service['timeout'] }}", - "token" : "{{ service['token'] }}" + "token" : "{{ service['token'] }}", "owner" : "{{ service['owner'] }}" }{% if not loop.last %},{% endif %} {% endfor %} diff --git a/roles/docker-deployments/templates/async-icinga.yaml b/roles/docker-deployments/templates/async-icinga.yaml index 5a08bd8..820454c 100644 --- a/roles/docker-deployments/templates/async-icinga.yaml +++ b/roles/docker-deployments/templates/async-icinga.yaml @@ -4,5 +4,5 @@ async-icinga: - "/data/async-icinga/instance/:/app/instance/" restart: always ports: - - 5006:5000 + - 6006:5000 image: registry.atlantishq.de/athq/async-icinga diff --git a/vars/services.yaml b/vars/services.yaml index d210592..cd01cc8 100644 --- a/vars/services.yaml +++ b/vars/services.yaml @@ -19,3 +19,5 @@ services: port: 8080 grafana: port: 3000 + async-icinga: + port: 5006