mirror of
https://github.com/famedly/ansible-collection-matrix
synced 2024-12-04 16:49:17 +00:00
feat(presents): add initial role
This commit is contained in:
parent
0017d08195
commit
6b9b7e58f1
7 changed files with 113 additions and 0 deletions
|
@ -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
37
roles/presents/README.md
Normal 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>
|
14
roles/presents/defaults/main.yml
Normal file
14
roles/presents/defaults/main.yml
Normal 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"
|
2
roles/presents/handlers/main.yml
Normal file
2
roles/presents/handlers/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# handlers file for presents
|
14
roles/presents/meta/main.yml
Normal file
14
roles/presents/meta/main.yml
Normal 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: []
|
40
roles/presents/tasks/main.yml
Normal file
40
roles/presents/tasks/main.yml
Normal 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 }}"
|
5
roles/presents/vars/main.yml
Normal file
5
roles/presents/vars/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
# vars file for presents
|
||||
matrix_presents_config:
|
||||
guest_homeserver: "{{ matrix_presents_guest_homeserver }}"
|
||||
base_uri: "{{ matrix_presents_base_uri }}"
|
Loading…
Reference in a new issue