20 Commits

Author SHA1 Message Date
7ef8eec19c feat(conduwuit): add ansible role 2025-04-09 19:50:44 +02:00
fb741aa3af update(synapse): bump version to 1.128.0 2025-04-08 20:50:03 +02:00
19fab5cd9f update(element): bump version to 1.11.97 2025-04-08 20:36:41 +02:00
9abedcd74c update(cinny): bump version to 4.6.0 2025-03-31 15:24:33 +02:00
4ede218929 meta: bump collection version to 0.1.7, require community.docker@^3.4.0 2025-03-28 16:02:48 +01:00
5fa6a5df09 update(synapse): bump version to 1.127.1 2025-03-27 18:41:27 +01:00
9ef9d399e6 update(synapse): bump version to 1.127.0 2025-03-25 18:08:39 +01:00
cf7d2e952a update(element): bump version to 1.11.96 2025-03-25 18:07:38 +01:00
6c37c1c586 update(element): bump version to 1.11.95 2025-03-13 19:12:54 +01:00
445f86552e update(synapse): bump version to 1.126.0 2025-03-12 21:30:04 +01:00
390ba88f0c update(cinny): bump version to 4.5.0 2025-03-04 15:40:22 +01:00
a8363bbd7c update(element): bump version to 1.11.94 2025-02-27 23:12:47 +01:00
4d3ff71ed5 update(element): bump version to 1.11.93 2025-02-25 20:45:04 +01:00
c8b336c1d1 update(synapse): bump version to 1.125.0 2025-02-25 19:57:53 +01:00
f1d2a1ae82 update(cinny): bump version to 4.4.0 2025-02-23 15:35:50 +01:00
7471d8e82c update(cinny): bump to version 4.3.2 2025-02-17 12:41:46 +01:00
481323e6a8 update(cinny): bump version to 4.3.0 2025-02-11 17:20:49 +01:00
fd0d9072d9 update(element): bump version to 1.11.92 2025-02-11 17:20:02 +01:00
d4cd40afe9 update(synapse): bump version to 1.124.0 2025-02-11 17:19:36 +01:00
89026dad21 chore(cinny): remove debug leftovers 2025-02-01 22:16:20 +01:00
16 changed files with 225 additions and 6 deletions

View File

@ -11,6 +11,7 @@ Roles for deploying matrix infrastructure using ansible.
## Roles
- [`cinny`](roles/cinny/README.md): [Cinny](https://cinny.in/) Web Client
- [`conduwuit`](roles/conduwuit/README.md): [conduwuit](https://conduwuit.puppyirl.gay/), a uwu fork of conduit
- [`element`](roles/element/README.md): [Element](https://element.io/) Web Client
- [`hydrogen`](roles/hydrogen/README.md): [Hydrogen](https://matrix.org/ecosystem/clients/hydrogen/) lightweight web client
- [`synapse`](roles/synapse/README.md): [Synapse](https://github.com/element-hq/synapse/),

View File

@ -1,12 +1,12 @@
namespace: finallycoffee
name: matrix
version: "0.1.6"
version: "0.1.7"
readme: README.md
authors:
- transcaffeine <transcaffeine@finally.coffee>
description: Various matrix-related ansible roles
dependencies:
"community.docker": "^3.0.0"
"community.docker": "^3.4.0"
license_file: LICENSE.md
build_ignore:
- '*.tar.gz'
@ -19,3 +19,4 @@ tags:
- element
- hydrogen
- cinny
- conduwuit

View File

@ -1,5 +1,4 @@
---
cinny_testvar: abc
cinny_config_complete: >-
{{ cinny_config | default({})
| combine(cinny_default_config | default({})) }}

View File

@ -1,7 +1,7 @@
---
cinny_user: cinny
cinny_state: "present"
cinny_version: "4.2.3"
cinny_version: "4.6.0"
cinny_deployment_method: "docker"
cinny_base_path: "/opt/cinny"

12
roles/conduwuit/README.md Normal file
View File

@ -0,0 +1,12 @@
# `finallycoffee.matrix.conduwuit` ansible role
Deploy [conduwuit](https://conduwuit.puppyirl.gay/), a fork of
conduit, written in rust and using rocksdb.
Please note that conduwuit is still under development.
## Required configuation
- `conduwuit_server_name` - domain the matrix server should be authoritative for.
Note that this can not be changed later!
- `conduwuit_config_registration_token` - when `conduwuit_config_allow_registration` is `true`

View File

@ -0,0 +1,26 @@
---
conduwuit_config_server_name: "{{ conduwuit_server_name }}"
conduwuit_config_address: ~
conduwuit_config_port: 8008
conduwuit_config_unix_socket_path: "/run/conduwuit/conduwuit.sock"
conduwuit_config_unix_socket_perms: "0660"
conduwuit_config_database_path: "{{ conduwuit_data_path }}"
conduwuit_config_allow_registration: false
conduwuit_config_registration_token: ~
conduwuit_config_registration_token_file: ~
conduwuit_config: {}
conduwuit_default_config:
server_name: "{{ conduwuit_config_server_name }}"
address: "{{ conduwuit_config_address }}"
port: "{{ conduwuit_config_port }}"
unix_socket_path: "{{ conduwuit_config_unix_socket_path }}"
unix_socket_perms: "{{ conduwuit_config_unix_socket_perms }}"
database_path: "{{ conduwuit_config_database_path }}"
allow_registration: "{{ conduwuit_config_allow_registration }}"
registration_token: "{{ conduwuit_config_registration_token }}"
registration_token_file: "{{ conduwuit_config_registration_token_file }}"
conduwuit_merged_config: >-2
{{ conduwuit_default_config | default({}, true)
| combine(conduwuit_config | default({}, true, recursive=True) }}

View File

@ -0,0 +1,44 @@
---
conduwuit_container_name: "conduwuit"
conduwuit_container_image: >-2
{{
[
conduwuit_container_image_repository,
conduwuit_container_image_tag | default(conduwuit_version, true)
]
}}
conduwuit_container_image_registry: ghcr.io
conduwuit_container_image_namespace: girlbossceo
conduwuit_container_image_name: conduwuit
conduwuit_container_image_repository: >-2
{{ conduwuit_container_image_registry
+ (('/' + conduwuit_container_image_namespace)
if conduwuit_container_image_namespace else '')
+ conduwuit_container_image_name }}
conduwuit_container_image_source: pull
conduwuit_container_image_force_source: >-2
{{ conduwuit_container_image_tag | bool }}
conduwuit_container_image_tag: ~
conduwuit_container_env:
CONDUWUIT_CONFIG: "{{ conduwuit_config_file }}"
conduwuit_container_user: "{{ conduwuit_run_uid }}:{{ conduwuit_run_gid }}"
conduwuit_container_ports: ~
conduwuit_container_labels: ~
conduwuit_container_ulimits: ~
conduwuit_container_networks: ~
conduwuit_container_dns_servers: ~
conduwuit_container_etc_hosts: ~
conduwuit_container_memory: ~
conduwuit_container_memory_reversation: ~
conduwuit_container_memory_swap: ~
conduwuit_container_state: >-2
{{ (conduwuit_state == 'present') | ternary('started', 'absent') }}
conduwuit_container_restart_policy: "on-failure"
conduwuit_container_default_volumes:
- "{{ conduwuit_config_file }}:{{ conduwuit_config_file }}:ro"
- "{{ conduwuit_data_path }}:{{ conduwuit_data_path }}:z"
conduwuit_container_volumes: ~
conduwuit_container_all_volumes: >-2
{{ conduwuit_container_default_volumes | default([], true)
+ conduwuit_container_volumes | default([], true) }}

View File

@ -0,0 +1,10 @@
---
conduwuit_user: conduwuit
conduwuit_version: "0.4.6"
conduwuit_server_name: ~
conduwuit_config_file: "/etc/conduwuit/conduwuit.toml"
conduwuit_data_path: "/var/lib/conduwuit"
conduwuit_state: present
conduwuit_deployment_method: docker

View File

@ -0,0 +1,6 @@
---
conduwuit_user_system: true
conduwuit_user_create_home: false
conduwuit_run_uid: "{{ conduwuit_user_info.uid | default(conduwuit_user) }}"
conduwuit_run_gid: "{{ conduwuit_user_info.gid | default(conduwuit_user) }}"

View File

@ -0,0 +1,34 @@
---
- name: Ensure 'conduwuit_state' is valid
ansible.builtin.fail:
msg: >-2
State '{{ conduwuit_state }}' is not known,
supported states are {{ conduwuit_states | join(', ') }}
when: conduwuit_state not in conduwuit_states
- name: Ensure 'conduwuit_deployment_method' is supported
ansible.builtin.fail:
msg: >-2
Deployment method '{{ conduwuit_deployment_method }}'
is unknown! Supported methods are:
{{ conduwuit_deployment_methods | join(', ') }}
when: conduwuit_deployment_method not in conduwuit_deployment_methods
- name: Ensure required variables are given
ansible.builtin.fail:
msg: "Required variable '{{ item }}' is undefined!"
loop: "{{ conduwuit_required_variables }}"
when: >-2
item not in hostvars[inventory_hostname]
or hostvars[inventory_hostname][item] | length == 0
- name: Ensure conditionally required variables are given
ansible.builtin.fail:
msg: "Required variable '{{ item.name }}' is undefined!"
loop: "{{ conduwuit_conditionally_required_variables }}"
loop_control:
label: "{{ item.name }}"
when: >-2
item.when
and (item.name not in hostvars[inventory_hostname]
or hostvars[inventory_hostname][item.name] | length == 0)

View File

@ -0,0 +1,26 @@
---
- name: Ensure container image '{{ conduwuit_container_image }}' is {{ conduwuit_state }}
community.docker.docker_image:
name: "{{ conduwuit_container_image }}"
state: "{{ conduwuit_state }}"
source: "{{ conduwuit_container_image_source }}"
force_source: "{{ conduwuit_container_image_force_source }}"
- name: Ensure container '{{ conduwuit_container_name }}' is {{ conduwuit_container_state }}
community.docker.docker_container:
name: "{{ conduwuit_container_name }}"
image: "{{ conduwuit_container_image }}"
env: "{{ conduwuit_container_env | default(omit) }}"
user: "{{ conduwuit_container_user }}"
ports: "{{ conduwuit_container_ports | default(omit, true) }}"
labels: "{{ conduwuit_container_labels | default(omit, true) }}"
volumes: "{{ conduwuit_container_all_volumes }}"
ulimits: "{{ conduwuit_container_ulimits | default(omit, true) }}"
networks: "{{ conduwuit_container_networks | default(omit, true) }}"
dns_servers: "{{ conduwuit_container_dns_servers | default(omit, true) }}"
etc_hosts: "{{ conduwuit_container_etc_hosts | default(omit, true) }}"
memory: "{{ conduwuit_container_memory | default(omit, true) }}"
memory_reservation: "{{ conduwuit_container_memory_reversation | default(omit, true) }}"
memory_swap: "{{ conduwuit_container_memory_swap | default(omit, true) }}"
restart_policy: "{{ conduwuit_container_restart_policy }}"
state: "{{ conduwuit_container_state }}"

View File

@ -0,0 +1,41 @@
---
- name: Check preconditions
ansible.builtin.include_tasks:
file: check.yml
- name: Ensure conduwuit user '{{ conduwuit_user }}' is {{ conduwuit_state }}
ansible.builtin.user:
name: "{{ conduwuit_user }}"
state: "{{ conduwuit_state }}"
system: "{{ conduwuit_user_system | default(true) }}"
create_home: "{{ conduwuit_user_create_home | default(false) }}"
register: conduwuit_user_info
- name: Ensure config directory exists
ansible.builtin.file:
path: "{{ conduwuit_config_file | dirname }}"
state: "{{ (conduwuit_state == 'present') | state('directory', 'absent') }}"
owner: "{{ conduwuit_run_uid }}"
group: "{{ conduwuit_run_gid }}"
mode: "0750"
- name: Template config file '{{ conduwuit_config_file }}'
ansible.builtin.template:
src: "conduwuit.toml.j2"
dest: "{{ conduwuit_config_file }}"
owner: "{{ conduwuit_run_uid }}"
group: "{{ conduwuit_run_gid }}"
mode: "0640"
when: conduwuit_state == 'present'
- name: Ensure data directory '{{ conduwuit_data_path }}' is {{ conduwuit_state }}
ansible.builtin.file:
path: "{{ conduwuit_data_path }}"
state: "{{ (conduwuit_state == 'present') | ternary('directory', 'absent') }}"
owner: "{{ conduwuit_run_uid }}"
group: "{{ conduwuit_run_gid }}"
mode: "0750"
- name: Ensure deployment using {{ conduwuit_deployment_method }} runs
ansible.builtin.include_tasks:
file: "deploy-{{ conduwuit_deployment_method }}"

View File

@ -0,0 +1,4 @@
[global]
{% for item in conduwuit_merged_config.global | dict2items %}
{{ item.key }}={{ item.value }}
{% endfor %}

View File

@ -0,0 +1,15 @@
---
conduwuit_states:
- "present"
- "absent"
conduwuit_deployment_methods:
- "docker"
conduwuit_required_variables:
- "conduwuit_server_name"
conduwuit_conditionally_required_variables:
- name: "conduwuit_config_registration_token"
when: >-2
{{ conduwuit_config_allow_registration and
not (conduwuit_config_registration_token_file | str | length > 0) }}

View File

@ -1,7 +1,7 @@
---
element_user: element
element_state: "present"
element_version: "1.11.91"
element_version: "1.11.97"
element_deployment_method: "docker"
element_base_path: "/opt/element"

View File

@ -1,7 +1,7 @@
---
synapse_user: synapse
synapse_group: synapse
synapse_version: "1.123.0"
synapse_version: "1.128.0"
synapse_state: "present"
synapse_deployment_method: "docker"