mirror of
https://github.com/famedly/ansible-collection-matrix
synced 2024-12-12 12:22:26 +00:00
feat(howler): add first base config (stolen from hedwig)
This commit is contained in:
parent
f6ee493e97
commit
f130a097a8
5 changed files with 69 additions and 0 deletions
1
roles/howler/README.md
Normal file
1
roles/howler/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Bonk @shekhina
|
14
roles/howler/defaults/main.yml
Normal file
14
roles/howler/defaults/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
howler_user: howler
|
||||||
|
howler_base_path: /opt/howler
|
||||||
|
howler_config_file: "{{ howler_base_path }}/config.toml"
|
||||||
|
howler_version: "0.1.0"
|
||||||
|
|
||||||
|
howler_container_name: "howler"
|
||||||
|
howler_container_image_name: "registry.gitlab.com/famedly/services/howler"
|
||||||
|
howler_container_image: "{{ howler_container_image_name }}:{{ howler_container_image_tag|default(['v', howler_version]|join()) }}"
|
||||||
|
howler_container_env: {}
|
||||||
|
howler_container_ports: []
|
||||||
|
howler_container_labels: {}
|
||||||
|
howler_container_restart_policy: "unless-stopped"
|
||||||
|
howler_container_extra_volumes: []
|
35
roles/howler/tasks/main.yml
Normal file
35
roles/howler/tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Create howler system user
|
||||||
|
user:
|
||||||
|
name: "{{ howler_user }}"
|
||||||
|
state: present
|
||||||
|
system: yes
|
||||||
|
register: howler_user_res
|
||||||
|
|
||||||
|
- name: Ensure host directories are present
|
||||||
|
file:
|
||||||
|
path: "{{ howler_base_path }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ howler_user_res.uid }}"
|
||||||
|
group: "{{ howler_user_res.group }}"
|
||||||
|
|
||||||
|
- name: Template configuration file for howler
|
||||||
|
template:
|
||||||
|
src: config.toml.j2
|
||||||
|
dest: "{{ howler_config_file }}"
|
||||||
|
owner: "{{ howler_user_res.uid }}"
|
||||||
|
group: "{{ howler_user_res.group }}"
|
||||||
|
mode: 0770
|
||||||
|
|
||||||
|
- name: Start howler container
|
||||||
|
docker_container:
|
||||||
|
name: "{{ howler_container_name }}"
|
||||||
|
image: "{{ howler_container_image }}"
|
||||||
|
env: "{{ howler_container_env }}"
|
||||||
|
user: "{{ howler_user_res.uid }}:{{ howler_user_res.group }}"
|
||||||
|
ports: "{{ howler_container_ports }}"
|
||||||
|
labels: "{{ howler_container_labels }}"
|
||||||
|
volumes: "{{ howler_container_volumes }}"
|
||||||
|
restart_policy: "{{ howler_container_restart_policy }}"
|
||||||
|
pull: true
|
13
roles/howler/templates/config.toml.j2
Normal file
13
roles/howler/templates/config.toml.j2
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
bots:
|
||||||
|
- user_id: "@howler:homeserver1.xyz"
|
||||||
|
homeserver: "https://homeserver1.xyz"
|
||||||
|
password: "correcthorsebatterystaple"
|
||||||
|
device_id: "bot"
|
||||||
|
message_timeout: 10
|
||||||
|
ratelimit: 1
|
||||||
|
default_templates:
|
||||||
|
plain: ./templates/default.plain
|
||||||
|
html: ./templates/default.html
|
||||||
|
receiver:
|
||||||
|
host: "howler.xyz:8080"
|
||||||
|
store_path: ~/.store/
|
6
roles/howler/vars/main.yml
Normal file
6
roles/howler/vars/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
hedwig_container_base_volumes:
|
||||||
|
- "{{ hedwig_config_file }}:/opt/hedwig/config.toml:ro"
|
||||||
|
|
||||||
|
hedwig_container_volumes: "{{ hedwig_container_base_volumes + hedwig_container_extra_volumes }}"
|
Loading…
Reference in a new issue