This repository has been archived on 2020-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
alerta.autonomic.zone/ansible/pre-deploy.yml

57 lines
1.5 KiB
YAML
Raw Normal View History

2020-04-08 17:45:03 +00:00
---
- hosts: all
gather_facts: false
tasks:
- name: Load variables
include_vars:
dir: "{{ dokku_lib_root }}/data/ansible/alerta/vars/"
extensions:
- yml
- name: "Configure the {{ domain }} domain"
dokku_domains:
app: alerta
domains:
- "{{ domain }}"
state: present
- name: Create postgres database
shell: "
dokku
postgres:create
alerta
--password {{ db_passwd }}
--root-password {{ root_db_passwd }}
"
args:
creates: /var/lib/dokku/services/postgres/alerta
- name: Link postgres database to application
dokku_service_link:
app: alerta
name: alerta
service: postgres
- name: Map application port to free host port
dokku_docker_options:
app: alerta
phase: run
2020-04-08 17:55:09 +00:00
option:
2020-04-08 17:45:03 +00:00
- "-p 3050:8080"
- name: Configure the dokku app environment
dokku_config:
app: alerta
restart: false
config:
ADMIN_KEY: "{{ alerta_admin_key }}"
ADMIN_PASSWORD: "{{ alerta_admin_passwd }}"
ALLOWED_KEYCLOAK_ROLES: "{{ keycloak_roles }}"
AUTH_PROVIDER: "{{ auth_provider }}"
AUTH_REQUIRED: "{{ auth_required }}"
DATABASE_NAME: "{{ db_name }}"
DATABASE_URL: "postgresql://{{ db_user }}:{{ db_passwd }}@{{ db_loc }}/{{ db_name }}"
KEYCLOAK_REALM: "{{ keycloak_realm }}"
KEYCLOAK_URL: "{{ keycloak_url }}"
SECRET_KEY: "{{ alerta_secret_key }}"