feat(howler): add first base config (stolen from hedwig)

This commit is contained in:
Jadyn Emma Jaeger 2021-04-19 17:44:49 +02:00 committed by Jadyn Emma Jaeger
parent f6ee493e97
commit f130a097a8
No known key found for this signature in database
GPG key ID: 632410170049FDDA
5 changed files with 69 additions and 0 deletions

1
roles/howler/README.md Normal file
View file

@ -0,0 +1 @@
# Bonk @shekhina

View 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: []

View 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

View 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/

View 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 }}"