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

63 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
2020-04-08 18:12:13 +00:00
no_log: true
2020-04-08 17:45:03 +00:00
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
2020-04-09 07:23:23 +00:00
- name: Create application directories
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:
2020-04-08 17:45:03 +00:00
app: alerta
2020-04-09 07:23:23 +00:00
mounts:
- /var/lib/alerta/alertad.conf:/app/alertad.conf
- /var/lib/alerta/config.json:/web/config.json