feat(presents): add initial role

This commit is contained in:
Jan Christian Grünhage 2021-02-10 21:43:35 +01:00
parent 0017d08195
commit 6b9b7e58f1
No known key found for this signature in database
GPG key ID: 6594C449C633D10C
7 changed files with 113 additions and 0 deletions

View file

@ -23,6 +23,7 @@ deploying commonly used matrix services:
- **synapse**: Homeserver, this is where your accounts live.
- **element**: Web client, for using your accounts.
- **presents**: Slideshow focused matrix client.
For details on using these, look at the README.md in the respective
role directory.

37
roles/presents/README.md Normal file
View file

@ -0,0 +1,37 @@
Matrix Presents
===============
Deployes a dockerized matrix-presents instance.
Requirements
------------
Docker and a homeserver with guests enabled.
Role Variables
--------------
- **matrix_presents_guest_homeserver**: Base URL for the homeserver that should handle the guest accounts.
- **matrix_presents_base_uri**: The URL where this should be hosted.
Example Playbook
----------------
```yaml
- hosts: ["matrix-presents-server"]
roles:
- famedly.matrix.presents
vars:
matrix_presents_guest_homeserver: "https://matrix.example.org"
matrix_presents_base_uri: "https://slides.example.org"
```
License
-------
AGPL-3.0-only
Author Information
------------------
Jan Christian Grünhage <jan.christian@gruenhage.xyz>

View file

@ -0,0 +1,14 @@
---
# defaults file for presents
matrix_presents_base_path: /opt/matrix-presents
matrix_presents_container_name: matrix-presents
matrix_presents_container_ref: registry.gitlab.com/famedly/services/matrix-presents
matrix_presents_container_tag: master
matrix_presents_docker_networks: []
matrix_presents_docker_etc_hosts: {}
matrix_presents_docker_ports: ["8080:8080"]
matrix_presents_docker_labels: {}
matrix_presents_docker_volumes:
- "{{ matrix_presents_base_path }}/config.json:/data/config.json"

View file

@ -0,0 +1,2 @@
---
# handlers file for presents

View file

@ -0,0 +1,14 @@
galaxy_info:
author: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
description: Deploys a dockerized matrix-presents instance
company: Famedly GmbH
issue_tracker_url: https://gitlab.com/famedly/ansible/collections/matrix/-/issues
license: AGPL-3.0-only
min_ansible_version: 2.9
galaxy_tags: []
dependencies: []

View file

@ -0,0 +1,40 @@
---
# tasks file for presents
- name: create user
become: yes
user:
name: matrix-presents
state: present
register: presents_user
- name: create directory
become: yes
file:
path: "{{ matrix_presents_base_path }}"
state: "directory"
owner: matrix-presents
group: matrix-presents
mode: 0750
- name: template config
become: yes
copy:
content: "{{ matrix_presents_config | to_nice_json }}"
dest: "{{ matrix_presents_base_path }}/config.json"
owner: matrix-presents
group: matrix-presents
mode: 0644
- name: start container
become: yes
docker_container:
name: "{{ matrix_presents_container_name }}"
image: "{{ matrix_presents_container_ref }}:{{ matrix_presents_container_tag }}"
networks: "{{ matrix_presents_docker_networks }}"
etc_hosts: "{{ matrix_presents_docker_etc_hosts }}"
ports: "{{ matrix_presents_docker_ports }}"
labels: "{{ matrix_presents_docker_labels }}"
restart_policy: "unless-stopped"
pull: true
user: "{{ presents_user.uid }}:{{ presents_user.group }}"
volumes: "{{ matrix_presents_docker_volumes }}"

View file

@ -0,0 +1,5 @@
---
# vars file for presents
matrix_presents_config:
guest_homeserver: "{{ matrix_presents_guest_homeserver }}"
base_uri: "{{ matrix_presents_base_uri }}"