57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
|
---
|
||
|
- 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
|
||
|
options:
|
||
|
- "-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 }}"
|