Pipe variables into the configuration

This commit is contained in:
Luke Murphy 2020-04-09 09:23:23 +02:00
parent 3190f33edb
commit 1a25064f97
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
4 changed files with 55 additions and 15 deletions

View File

@ -33,12 +33,30 @@
name: alerta name: alerta
service: postgres service: postgres
- name: Configure the dokku app environment - name: Create application directories
dokku_config: become: true
file:
path: /var/lib/alerta
state: directory
owner: dokku
group: dokku
- name: Copy over templated configuration files
become: true
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: dokku
group: dokku
with_items:
- src: alertad.conf
dest: /var/lib/alerta/alertad.conf
- src: config.json
dest: /var/lib/alerta/config.json
- name: Specify docker volume mounts
dokku_storage:
app: alerta app: alerta
restart: false mounts:
config: - /var/lib/alerta/alertad.conf:/app/alertad.conf
ADMIN_KEY: "{{ alerta_admin_key }}" - /var/lib/alerta/config.json:/web/config.json
ADMIN_PASSWORD: "{{ alerta_admin_passwd }}"
DATABASE_NAME: "{{ db_name }}"
DATABASE_URL: "postgresql://{{ db_user }}:{{ db_passwd }}@{{ db_loc }}/{{ db_name }}"

View File

@ -1,5 +0,0 @@
[DEFAULT]
sslverify = no
output = psql
endpoint = http://localhost:8080/api
timezone = Europe/London

View File

@ -1,6 +1,15 @@
DEBUG = True SITE_LOGO_URL = 'https://www.coops.tech/images/coops/autonomic'
SECRET = "^Bpa%i8_nCAc8fI4l9)nhn2EG2!@GJga"
DEBUG = False
SECRET = "{{ alerta_secrey_key }}"
AUTH_REQUIRED = True AUTH_REQUIRED = True
AUTH_PROVIDER = 'keycloak'
KEYCLOAK_URL = "{{ keycloak_url }}"
KEYCLOAK_REALM = "{{ keycloak_realm }}"
ALLOWED_KEYCLOAK_ROLES = "{{ keycloak_roles }}"
SEVERITY_MAP = { SEVERITY_MAP = {
'fatal': 0, 'fatal': 0,
@ -17,8 +26,23 @@ SEVERITY_MAP = {
'trace': 8, 'trace': 8,
'unknown': 9 'unknown': 9
} }
DEFAULT_NORMAL_SEVERITY = 'normal' # 'normal', 'ok', 'cleared' DEFAULT_NORMAL_SEVERITY = 'normal' # 'normal', 'ok', 'cleared'
DEFAULT_PREVIOUS_SEVERITY = 'indeterminate' DEFAULT_PREVIOUS_SEVERITY = 'indeterminate'
PLUGINS = ['reject', 'blackout', 'geoip', 'normalise'] PLUGINS = ['reject', 'blackout', 'geoip', 'normalise']
GEOIP_URL = 'http://ip-api.com/json' GEOIP_URL = 'http://ip-api.com/json'
DATABASE_URL = "postgresql://{{ db_user }}:{{ db_passwd }}@{{ db_loc }}/{{ db_name }}"
DATABASE_NAME = "{{ db_name }}"
EMAIL_VERIFICATION = False
# Note(decentral1se): enable once we have mail addresses
# https://docs.alerta.io/en/latest/configuration.html#email-settings
# MAIL_FROM = 'TODO'
# SMTP_HOST = 'TODO'
# SMTP_PASSWORD = 'TODO'
# SMTP_PORT = 'TODO'
# SMTP_STARTTLS = 'TODO'
# SMTP_USERNAME = 'TODO'

View File

@ -4,3 +4,6 @@ db_name: "alerta"
db_user: "postgres" db_user: "postgres"
domain: "alerta.autonomic.zone" domain: "alerta.autonomic.zone"
http_port: "8080" http_port: "8080"
keycloak_realm: "Autonomic"
keycloak_roles: "Worker-Owner"
keycloak_url: "https://id.autonomic.zone"