45 lines
1.1 KiB
YAML
45 lines
1.1 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
|
|
no_log: true
|
|
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: Configure the dokku app environment
|
|
dokku_config:
|
|
app: alerta
|
|
restart: false
|
|
config:
|
|
ADMIN_KEY: "{{ alerta_admin_key }}"
|
|
ADMIN_PASSWORD: "{{ alerta_admin_passwd }}"
|
|
DATABASE_NAME: "{{ db_name }}"
|
|
DATABASE_URL: "postgresql://{{ db_user }}:{{ db_passwd }}@{{ db_loc }}/{{ db_name }}"
|