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
|
|
|
|
|
2020-04-09 19:30:12 +00:00
|
|
|
- name: Create mongo database
|
2020-04-08 18:12:13 +00:00
|
|
|
no_log: true
|
2020-04-08 17:45:03 +00:00
|
|
|
shell: "
|
|
|
|
dokku
|
2020-04-09 19:30:12 +00:00
|
|
|
mongo:create
|
2020-04-08 17:45:03 +00:00
|
|
|
alerta
|
|
|
|
--password {{ db_passwd }}
|
|
|
|
--root-password {{ root_db_passwd }}
|
|
|
|
"
|
|
|
|
args:
|
2020-04-09 19:30:12 +00:00
|
|
|
creates: /var/lib/dokku/services/mongo/alerta
|
2020-04-08 17:45:03 +00:00
|
|
|
|
2020-04-09 19:30:12 +00:00
|
|
|
- name: Link mongo database to application
|
2020-04-08 17:45:03 +00:00
|
|
|
dokku_service_link:
|
|
|
|
app: alerta
|
|
|
|
name: alerta
|
2020-04-09 19:30:12 +00:00
|
|
|
service: mongo
|
2020-04-08 17:45:03 +00:00
|
|
|
|
2020-04-09 07:23:23 +00:00
|
|
|
- name: Create application directories
|
|
|
|
become: true
|
|
|
|
file:
|
|
|
|
path: /var/lib/alerta
|
|
|
|
state: directory
|
2020-04-09 19:43:35 +00:00
|
|
|
owner: dokku
|
|
|
|
group: dokku
|
2020-04-09 07:23:23 +00:00
|
|
|
|
2020-04-10 07:05:05 +00:00
|
|
|
- name: Copy over the /web/ configurations
|
2020-04-09 07:23:23 +00:00
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
2020-04-10 06:25:01 +00:00
|
|
|
owner: "{{ docker_user_uid }}"
|
|
|
|
group: "{{ docker_user_gid }}"
|
2020-04-10 06:32:07 +00:00
|
|
|
mode: 0664
|
2020-04-09 07:23:23 +00:00
|
|
|
with_items:
|
|
|
|
- src: config.json
|
|
|
|
dest: /var/lib/alerta/config.json
|
2020-04-10 07:05:05 +00:00
|
|
|
|
|
|
|
- name: Copy over the /app/ configurations
|
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0664
|
|
|
|
with_items:
|
2020-04-09 17:07:20 +00:00
|
|
|
- src: alerta.conf
|
|
|
|
dest: /var/lib/alerta/alerta.conf
|
2020-04-10 07:05:05 +00:00
|
|
|
- src: alertad.conf
|
|
|
|
dest: /var/lib/alerta/alertad.conf
|
2020-04-09 07:23:23 +00:00
|
|
|
|
|
|
|
- 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:
|
2020-04-09 17:07:20 +00:00
|
|
|
- /var/lib/alerta/alerta.conf:/app/alerta.conf
|
2020-04-09 07:23:23 +00:00
|
|
|
- /var/lib/alerta/alertad.conf:/app/alertad.conf
|
|
|
|
- /var/lib/alerta/config.json:/web/config.json
|