Skip to content
Snippets Groups Projects
Commit a879835e authored by Christian Elberfeld's avatar Christian Elberfeld
Browse files

removed alerta and keycloak

parent 82d4e31f
No related branches found
No related tags found
No related merge requests found
...@@ -52,13 +52,11 @@ ...@@ -52,13 +52,11 @@
- { role: common/nginx, tags: nginx } - { role: common/nginx, tags: nginx }
- { role: common/openvpn, tags: openvpn } - { role: common/openvpn, tags: openvpn }
- { role: common/docker_ldap, tags: ldap } - { role: common/docker_ldap, tags: ldap }
- { role: webserver/docker_alerta, tags: alerta }
- { role: webserver/docker_dokuwiki, tags: dokuwiki } - { role: webserver/docker_dokuwiki, tags: dokuwiki }
- { role: webserver/docker_etherpad, tags: etherpad } - { role: webserver/docker_etherpad, tags: etherpad }
- { role: webserver/docker_gitlab, tags: gitlab } - { role: webserver/docker_gitlab, tags: gitlab }
- { role: webserver/docker_hackmd, tags: hackmd } - { role: webserver/docker_hackmd, tags: hackmd }
- { role: webserver/docker_jabber, tags: jabber } - { role: webserver/docker_jabber, tags: jabber }
- { role: webserver/docker_keycloak, tags: keycloak }
- { role: webserver/docker_matterbridge, tags: matterbridge } - { role: webserver/docker_matterbridge, tags: matterbridge }
- { role: webserver/docker_matrix, tags: matrix } - { role: webserver/docker_matrix, tags: matrix }
- { role: webserver/docker_warpapi, tags: warpapi } - { role: webserver/docker_warpapi, tags: warpapi }
......
---
- name: restart alerta docker
docker_service:
project_src: /srv/alerta/
state: present
restarted: yes
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: /srv/alerta/alerta_secret_key, length: 24 }
- { path: /srv/alerta/alerta_oauth_client_secret, length: -1 }
- { path: /srv/alerta/alerta_token, length: -1 }
- { path: /srv/alerta/telegram_token, length: -1 }
- { path: /srv/alerta/telegram_chatid, length: -1 }
- name: create folder struct for alerta
file:
path: "{{ item }}"
state: "directory"
with_items:
- /srv/alerta/
- /srv/alerta/db/
- name: Konfig-Dateien erstellen
template:
src: "{{ item }}"
dest: "/srv/alerta/{{ item }}"
with_items:
- docker-compose.yml
- alertad.conf
- config.js
- telegram.txt
notify: restart alerta docker
- name: Script-Dateien erstellen
template:
src: "{{ item }}"
dest: "/srv/alerta/{{ item }}"
mode: "o+rwx"
with_items:
- testalert.sh
- name: start alerta docker
docker_service:
project_src: /srv/alerta/
state: present
DEBUG = False
PLUGINS = [ 'blackout','normalise','reject','telegram' ]
SENDER_API_ALLOW = 'ON'
BLACKOUT_DURATION = 43200
ALLOWED_ENVIRONMENTS = [ 'warpzone' ]
KEYCLOAK_URL = 'https://auth.warpzone.ms'
KEYCLOAK_REALM = 'master'
OAUTH2_CLIENT_ID = 'alerta-ui'
OAUTH2_CLIENT_SECRET = '{{ alerta_oauth_client_secret }}'
ALLOWED_KEYCLOAK_ROLES = [ '*' ]
SECRET_KEY = '{{ alerta_secret_key }}'
DATABASE_URL = 'postgres://alerta:alerta@db:5432/alerta'
AUTH_REQUIRED = True
ADMIN_USERS = [ '' ]
CUSTOMER_VIEWS = False
TELEGRAM_TOKEN = '{{ telegram_token }}'
TELEGRAM_CHAT_ID = '{{ telegram_chatid }}'
TELEGRAM_TEMPLATE = "/app/telegram.txt"
'use strict';
angular.module('config', [])
.constant('config', {
'endpoint' : "https://"+window.location.hostname+"/api",
'provider' : "keycloak", // google, github, gitlab, saml2 or basic
'client_id' : "alerta-ui",
'keycloak_url': "https://auth.warpzone.ms",
'keycloak_realm': "master",
'dates': {
'shortTime' : 'HH:MM',
'mediumDate': 'd.MM.yyyy',
'longDate' : 'EEEE, MMMM d, yyyy HH:MM ss.sss (Z)' // Tuesday, April 26, 2016 13:39:43.987 (+0100)
},
'refresh_interval': 30000 // Auto-refresh interval set to 30 seconds
});
version: "3"
services:
app:
image: alerta/alerta-web:5.2.4
restart: always
ports:
- 0.0.0.0:42008:8080
volumes:
- /srv/alerta/alertad.conf:/app/alertad.conf
- /srv/alerta/telegram.txt:/app/telegram.txt
- /srv/alerta/config.js:/web/config.js
depends_on:
- db
environment:
INSTALL_PLUGINS: "normalise,telegram"
db:
image: postgres
restart: always
volumes:
- /srv/alerta/db:/var/lib/postgresql/data
environment:
POSTGRES_DB: alerta
POSTGRES_USER: alerta
POSTGRES_PASSWORD: alerta
{% raw %}
{% if customer %}Customer: `{{customer}}` {% endif %}
*[{{ status.capitalize() }}] {{ environment }} {{ severity.capitalize() }}*
{{ event | replace("_","\_") }} {{ resource.capitalize() }}
```
{{ text }}
```
https://alerta.warpzone.ms/#/alert/{{ id }}
{% endraw %}
\ No newline at end of file
#!/bin/sh
curl -XPOST https://alerta.warpzone.ms/api/alert \
-H 'Authorization: Key {{alerta_token}}' \
-H 'Content-type: application/json' \
-d '{
"attributes": {
"region": "EU"
},
"correlate": [
"HttpServerError",
"HttpServerOK"
],
"environment": "warpzone",
"event": "HttpServerError",
"group": "Web",
"origin": "curl",
"resource": "web01",
"service": [
"example.com"
],
"severity": "major",
"tags": [
"dc1"
],
"text": "Site is down.",
"type": "exceptionAlert",
"value": "Bad Gateway (501)"
}'
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: /srv/keycloak/keycloak_admin_pass, length: 24 }
- { path: /srv/keycloak/postgres_user_pass, length: 12 }
- name: create folder struct for keycloak
file:
path: "{{ item }}"
state: "directory"
with_items:
- /srv/keycloak/
- /srv/keycloak/db/
- name: Konfig-Dateien erstellen
template:
src: "{{ item }}"
dest: "/srv/keycloak/{{ item }}"
with_items:
- docker-compose.yml
notify: restart keycloak docker
- name: start keycloak docker
docker_service:
project_src: /srv/keycloak/
state: present
version: "3"
services:
app:
image: jboss/keycloak:4.0.0.Final
restart: always
ports:
- 127.0.0.1:42009:8080
depends_on:
- db
environment:
KEYCLOAK_USER: "admin"
KEYCLOAK_PASSWORD: "{{ keycloak_admin_pass }}"
DB_VENDOR: "POSTGRES"
DB_ADDR: "db"
DB_DATABASE: "keycloak"
DB_USER: "keycloak"
DB_PASSWORD: "{{ postgres_user_pass }}"
PROXY_ADDRESS_FORWARDING: "true"
db:
image: postgres
restart: always
volumes:
- /srv/keycloak/db:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: "{{ postgres_user_pass }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment