Compare commits
1 Commits
transcaffe
...
1e31adef1f
Author | SHA1 | Date | |
---|---|---|---|
1e31adef1f
|
@ -11,7 +11,6 @@ Roles for deploying matrix infrastructure using ansible.
|
|||||||
## Roles
|
## Roles
|
||||||
|
|
||||||
- [`cinny`](roles/cinny/README.md): [Cinny](https://cinny.in/) Web Client
|
- [`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
|
- [`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
|
- [`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/),
|
- [`synapse`](roles/synapse/README.md): [Synapse](https://github.com/element-hq/synapse/),
|
||||||
|
12
galaxy.yml
12
galaxy.yml
@ -1,22 +1,12 @@
|
|||||||
namespace: finallycoffee
|
namespace: finallycoffee
|
||||||
name: matrix
|
name: matrix
|
||||||
version: "0.1.7"
|
version: 0.1.1
|
||||||
readme: README.md
|
readme: README.md
|
||||||
authors:
|
authors:
|
||||||
- transcaffeine <transcaffeine@finally.coffee>
|
- transcaffeine <transcaffeine@finally.coffee>
|
||||||
description: Various matrix-related ansible roles
|
description: Various matrix-related ansible roles
|
||||||
dependencies:
|
|
||||||
"community.docker": "^3.4.0"
|
|
||||||
license_file: LICENSE.md
|
license_file: LICENSE.md
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
repository: https://git.finally.coffee/finallycoffee/matrix
|
repository: https://git.finally.coffee/finallycoffee/matrix
|
||||||
issues: https://codeberg.org/finallycoffee/ansible-collection-matrix/issues
|
issues: https://codeberg.org/finallycoffee/ansible-collection-matrix/issues
|
||||||
tags:
|
|
||||||
- matrix
|
|
||||||
- synapse
|
|
||||||
- homeserver
|
|
||||||
- element
|
|
||||||
- hydrogen
|
|
||||||
- cinny
|
|
||||||
- conduwuit
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
cinny_testvar: abc
|
||||||
cinny_config_complete: >-
|
cinny_config_complete: >-
|
||||||
{{ cinny_config | default({})
|
{{ cinny_config | default({})
|
||||||
| combine(cinny_default_config | default({})) }}
|
| combine(cinny_default_config | default({})) }}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
cinny_user: cinny
|
cinny_user: cinny
|
||||||
cinny_state: "present"
|
cinny_state: "present"
|
||||||
cinny_version: "4.6.0"
|
cinny_version: "4.2.1"
|
||||||
cinny_deployment_method: "docker"
|
cinny_deployment_method: "docker"
|
||||||
|
|
||||||
cinny_base_path: "/opt/cinny"
|
cinny_base_path: "/opt/cinny"
|
||||||
|
@ -14,6 +14,7 @@ are available under the `cinny_container_` prefix:
|
|||||||
- `labels`
|
- `labels`
|
||||||
- `networks`
|
- `networks`
|
||||||
- `etc_hosts`
|
- `etc_hosts`
|
||||||
|
- `purge_networks`
|
||||||
|
|
||||||
The following variables are pre-populated by the role, so override them with care:
|
The following variables are pre-populated by the role, so override them with care:
|
||||||
|
|
||||||
|
@ -30,3 +30,4 @@
|
|||||||
networks: "{{ cinny_container_networks | default(omit) }}"
|
networks: "{{ cinny_container_networks | default(omit) }}"
|
||||||
etc_hosts: "{{ cinny_container_etc_hosts | default(omit) }}"
|
etc_hosts: "{{ cinny_container_etc_hosts | default(omit) }}"
|
||||||
restart_policy: "{{ cinny_container_restart_policy }}"
|
restart_policy: "{{ cinny_container_restart_policy }}"
|
||||||
|
purge_networks: "{{ cinny_container_purge_networks | default(omit) }}"
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
# `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`
|
|
@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
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) }}
|
|
@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
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) }}
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
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
|
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
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) }}"
|
|
@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
- 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)
|
|
@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
- 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 }}"
|
|
@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
- 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 }}"
|
|
@ -1,4 +0,0 @@
|
|||||||
[global]
|
|
||||||
{% for item in conduwuit_merged_config.global | dict2items %}
|
|
||||||
{{ item.key }}={{ item.value }}
|
|
||||||
{% endfor %}
|
|
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
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) }}
|
|
@ -11,15 +11,12 @@ element_container_image_registry: "docker.io"
|
|||||||
element_container_image_namespace: "vectorim"
|
element_container_image_namespace: "vectorim"
|
||||||
element_container_image_name: "element-web"
|
element_container_image_name: "element-web"
|
||||||
element_container_image_tag: ~
|
element_container_image_tag: ~
|
||||||
element_container_image_source: pull
|
|
||||||
element_container_image_force_source: >-2
|
|
||||||
{{ element_container_image_tag | default(false, true) | bool }}
|
|
||||||
element_container_name: "element-web"
|
element_container_name: "element-web"
|
||||||
element_container_restart_policy: >-
|
element_container_restart_policy: >-
|
||||||
{{ (element_deployment_method == 'docker')
|
{{ (element_deployment_method == 'docker')
|
||||||
| ternary('unless-stopped',
|
| ternary('unless-stopped',
|
||||||
(element_deployment_method == 'podman' |
|
(element_deployment_method == 'podman' |
|
||||||
ternary('on-failure', 'always')))
|
ternary('on-failure', 'always'))
|
||||||
}}
|
}}
|
||||||
element_container_full_volumes: >-
|
element_container_full_volumes: >-
|
||||||
{{ element_container_default_volumes
|
{{ element_container_default_volumes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
element_user: element
|
element_user: element
|
||||||
element_state: "present"
|
element_state: "present"
|
||||||
element_version: "1.11.97"
|
element_version: "1.11.77"
|
||||||
element_deployment_method: "docker"
|
element_deployment_method: "docker"
|
||||||
|
|
||||||
element_base_path: "/opt/element"
|
element_base_path: "/opt/element"
|
||||||
@ -10,9 +10,9 @@ element_dist_path: "{{ element_source_path }}/dist"
|
|||||||
element_config_path: "{{ element_base_path }}/config"
|
element_config_path: "{{ element_base_path }}/config"
|
||||||
element_config_file: "{{ element_config_path }}/config.json"
|
element_config_file: "{{ element_config_path }}/config.json"
|
||||||
|
|
||||||
element_host_uid: >-2
|
element_host_uid: >-
|
||||||
{{ ((element_user_info is defined) and ('uid' in element_user_info))
|
{{ element_user_info is defined
|
||||||
| ternary(element_user_info.uid, element_user) }}
|
| ternary(element_user_info.uid, element_user) }}
|
||||||
element_host_gid: >-2
|
element_host_gid: >-
|
||||||
{{ ((element_user_info is defined) and ('uid' in element_user_info))
|
{{ element_user_info is defined
|
||||||
| ternary(element_user_info.group, element_user) }}
|
| ternary(element_user_info.group, element_user) }}
|
||||||
|
@ -14,6 +14,7 @@ are available under the `element_container_` prefix:
|
|||||||
- `labels`
|
- `labels`
|
||||||
- `networks`
|
- `networks`
|
||||||
- `etc_hosts`
|
- `etc_hosts`
|
||||||
|
- `purge_networks`
|
||||||
|
|
||||||
The following variables are pre-populated by the role, so override them with care:
|
The following variables are pre-populated by the role, so override them with care:
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
community.docker.docker_image:
|
community.docker.docker_image:
|
||||||
name: "{{ element_container_image }}"
|
name: "{{ element_container_image }}"
|
||||||
state: "{{ element_state }}"
|
state: "{{ element_state }}"
|
||||||
source: "{{ element_container_image_source }}"
|
source: "{{ element_container_source }}"
|
||||||
force_source: "{{ element_container_image_force_source }}"
|
force_source: "{{ element_container_image_tag | default(false, true) }}"
|
||||||
|
|
||||||
- name: Ensure container '{{ element_container_name }}' is {{ element_state }}
|
- name: Ensure container '{{ element_container_name }}' is {{ element_state }}
|
||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
@ -23,10 +23,11 @@
|
|||||||
image: "{{ element_container_image }}"
|
image: "{{ element_container_image }}"
|
||||||
state: "{{ (element_state == 'present') | ternary('started', 'absent') }}"
|
state: "{{ (element_state == 'present') | ternary('started', 'absent') }}"
|
||||||
env: "{{ element_container_env | default(omit) }}"
|
env: "{{ element_container_env | default(omit) }}"
|
||||||
user: "{{ element_container_user | default(omit) }}"
|
user: "{{ element_container_user }}"
|
||||||
ports: "{{ element_container_ports | default(omit) }}"
|
ports: "{{ element_container_ports | default(omit) }}"
|
||||||
labels: "{{ element_container_labels | default(omit) }}"
|
labels: "{{ element_container_labels | default(omit) }}"
|
||||||
volumes: "{{ element_container_full_volumes }}"
|
volumes: "{{ element_container_full_volumes }}"
|
||||||
networks: "{{ element_container_networks | default(omit) }}"
|
networks: "{{ element_container_networks | default(omit) }}"
|
||||||
etc_hosts: "{{ element_container_etc_hosts | default(omit) }}"
|
etc_hosts: "{{ element_container_etc_hosts | default(omit) }}"
|
||||||
restart_policy: "{{ element_container_restart_policy }}"
|
restart_policy: "{{ element_container_restart_policy }}"
|
||||||
|
purge_networks: "{{ element_container_purge_networks | default(omit) }}"
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
containers.podman.podman_image:
|
containers.podman.podman_image:
|
||||||
name: "{{ element_container_image }}"
|
name: "{{ element_container_image }}"
|
||||||
state: "{{ element_state }}"
|
state: "{{ element_state }}"
|
||||||
pull: "{{ element_container_image_source == 'pull' }}"
|
pull: "{{ element_container_source == 'pull' }}"
|
||||||
force: "{{ element_container_image_force_source }}"
|
force: "{{ element_container_image_tag | default(false, true) }}"
|
||||||
|
|
||||||
- name: Ensure container '{{ element_container_name }}' is {{ element_state }}
|
- name: Ensure container '{{ element_container_name }}' is {{ element_state }}
|
||||||
containers.podman.podman_container:
|
containers.podman.podman_container:
|
||||||
@ -12,7 +12,7 @@
|
|||||||
image: "{{ element_container_image }}"
|
image: "{{ element_container_image }}"
|
||||||
state: "{{ (element_state == 'present') | ternary('started', 'absent') }}"
|
state: "{{ (element_state == 'present') | ternary('started', 'absent') }}"
|
||||||
env: "{{ element_container_env | default(omit) }}"
|
env: "{{ element_container_env | default(omit) }}"
|
||||||
user: "{{ element_container_user | default(omit) }}"
|
user: "{{ element_container_user }}"
|
||||||
ports: "{{ element_container_ports | default(omit) }}"
|
ports: "{{ element_container_ports | default(omit) }}"
|
||||||
labels: "{{ element_container_labels | default(omit) }}"
|
labels: "{{ element_container_labels | default(omit) }}"
|
||||||
volumes: "{{ element_container_full_volumes }}"
|
volumes: "{{ element_container_full_volumes }}"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
element_states:
|
element_state:
|
||||||
- present
|
- present
|
||||||
- absent
|
- absent
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ hydrogen_container_image: >-2
|
|||||||
([
|
([
|
||||||
hydrogen_container_image_server,
|
hydrogen_container_image_server,
|
||||||
hydrogen_container_image_namespace,
|
hydrogen_container_image_namespace,
|
||||||
hydrogen_container_image_name,
|
hydrogen_container_image_name
|
||||||
] | join('/'))
|
] | join('/'))
|
||||||
+ ':' + (hydrogen_container_image_tag
|
+ ':' + (hydrogen_container_image_tag
|
||||||
| default('v' + hydrogen_version, true))
|
| default('v' + hydrogen_version), true)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
hydrogen_container_working_directory: "/usr/share/nginx/html"
|
hydrogen_container_working_directory: "/usr/share/nginx/html"
|
||||||
@ -28,7 +28,7 @@ hydrogen_container_image_source: pull
|
|||||||
hydrogen_container_image_force_source: >-2
|
hydrogen_container_image_force_source: >-2
|
||||||
{{ hydrogen_container_image_tag | default(false, true) | bool }}
|
{{ hydrogen_container_image_tag | default(false, true) | bool }}
|
||||||
hydrogen_container_state: >-2
|
hydrogen_container_state: >-2
|
||||||
{{ (hydrogen_state == 'present') | ternary('started', 'absent') }}
|
{{ (hydrogen-state == 'present') | ternary('started', 'absent') }}
|
||||||
hydrogen_container_env: ~
|
hydrogen_container_env: ~
|
||||||
hydrogen_container_user: >-2
|
hydrogen_container_user: >-2
|
||||||
{{ hydrogen_run_user_id }}:{{ hydrogen_run_group_id }}
|
{{ hydrogen_run_user_id }}:{{ hydrogen_run_group_id }}
|
||||||
@ -37,6 +37,7 @@ hydrogen_container_labels: ~
|
|||||||
hydrogen_container_ulimits: ~
|
hydrogen_container_ulimits: ~
|
||||||
hydrogen_container_volumes: ~
|
hydrogen_container_volumes: ~
|
||||||
hydrogen_container_networks: ~
|
hydrogen_container_networks: ~
|
||||||
|
hydrogen_container_purge_networks: ~
|
||||||
hydrogen_container_dns_servers: ~
|
hydrogen_container_dns_servers: ~
|
||||||
hydrogen_container_etc_hosts: ~
|
hydrogen_container_etc_hosts: ~
|
||||||
hydrogen_container_restart_policy: unless-stopped
|
hydrogen_container_restart_policy: unless-stopped
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
---
|
---
|
||||||
hydrogen_state: present
|
|
||||||
hydrogen_user: hydrogen
|
hydrogen_user: hydrogen
|
||||||
hydrogen_version: "0.5.1"
|
hydrogen_version: "0.5.0"
|
||||||
hydrogen_deployment_method: docker
|
|
||||||
|
|
||||||
hydrogen_config_file: "/etc/hydrogen/config.json"
|
hydrogen_config_file: "/etc/hydrogen/config.json"
|
||||||
|
|
||||||
|
@ -9,4 +9,3 @@ galaxy_info:
|
|||||||
- matrix
|
- matrix
|
||||||
- matrix-client
|
- matrix-client
|
||||||
- docker
|
- docker
|
||||||
- podman
|
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
ulimits: "{{ hydrogen_container_ulimits | default(omit, true) }}"
|
ulimits: "{{ hydrogen_container_ulimits | default(omit, true) }}"
|
||||||
volumes: "{{ hydrogen_container_volumes }}"
|
volumes: "{{ hydrogen_container_volumes }}"
|
||||||
networks: "{{ hydrogen_container_networks | default(omit, true) }}"
|
networks: "{{ hydrogen_container_networks | default(omit, true) }}"
|
||||||
|
purge_networks: >-2
|
||||||
|
{{ hydrogen_container_purge_networks | default(omit, true) }}
|
||||||
dns_servers: >-2
|
dns_servers: >-2
|
||||||
{{ hydrogen_container_dns_servers | default(omit, true) }}
|
{{ hydrogen_container_dns_servers | default(omit, true) }}
|
||||||
etc_hosts: >-2
|
etc_hosts: >-2
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Ensure container image '{{ hydrogen_container_image }}' is {{ hydrogen_state }} on host
|
|
||||||
containers.podman.podman_image:
|
|
||||||
name: "{{ hydrogen_container_image }}"
|
|
||||||
state: "{{ hydrogen_state }}"
|
|
||||||
pull: "{{ hydrogen_container_image_source == 'pull' }}"
|
|
||||||
force: "{{ hydrogen_container_image_force_source }}"
|
|
||||||
register: hydrogen_container_image_info
|
|
||||||
until: hydrogen_container_image_info is success
|
|
||||||
retries: 5
|
|
||||||
delay: 3
|
|
||||||
|
|
||||||
- name: Ensure hydrogen container '{{ hydrogen_container_name }}' is {{ hydrogen_container_state }}
|
|
||||||
containers.podman.podman_container:
|
|
||||||
name: "{{ hydrogen_container_name }}"
|
|
||||||
image: "{{ hydrogen_container_image }}"
|
|
||||||
env: "{{ hydrogen_container_env | default(omit, true) }}"
|
|
||||||
user: "{{ hydrogen_container_user }}"
|
|
||||||
ports: "{{ hydrogen_container_ports | default(omit, true) }}"
|
|
||||||
labels: "{{ hydrogen_container_labels | default(omit, true) }}"
|
|
||||||
ulimits: "{{ hydrogen_container_ulimits | default(omit, true) }}"
|
|
||||||
volumes: "{{ hydrogen_container_volumes }}"
|
|
||||||
network: "{{ hydrogen_container_networks | default(omit, true) }}"
|
|
||||||
dns_servers: >-2
|
|
||||||
{{ hydrogen_container_dns_servers | default(omit, true) }}
|
|
||||||
etc_hosts: >-2
|
|
||||||
{{ hydrogen_container_etc_hosts | default(omit, true) }}
|
|
||||||
restart_policy: >-2
|
|
||||||
{{ hydrogen_container_restart_policy | default(omit, true) }}
|
|
||||||
state: "{{ hydrogen_container_state }}"
|
|
@ -21,9 +21,7 @@
|
|||||||
groups: "{{ hydrogen_user_groups | default(omit, true) }}"
|
groups: "{{ hydrogen_user_groups | default(omit, true) }}"
|
||||||
append: >-2
|
append: >-2
|
||||||
{{ hydrogen_user_append_groups
|
{{ hydrogen_user_append_groups
|
||||||
| default(hydrogen_user_groups | default([]) | length > 0, true)
|
| default(hydrogen_user_groups | default([]) | length > 0, true) }}"
|
||||||
| bool
|
|
||||||
}}
|
|
||||||
state: "{{ hydrogen_state }}"
|
state: "{{ hydrogen_state }}"
|
||||||
register: hydrogen_user_info
|
register: hydrogen_user_info
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ hydrogen_states:
|
|||||||
- absent
|
- absent
|
||||||
hydrogen_deployment_methods:
|
hydrogen_deployment_methods:
|
||||||
- docker
|
- docker
|
||||||
- podman
|
|
||||||
|
@ -30,6 +30,7 @@ synapse_container_ports: ~
|
|||||||
synapse_container_labels: ~
|
synapse_container_labels: ~
|
||||||
synapse_container_ulimits: ~
|
synapse_container_ulimits: ~
|
||||||
synapse_container_networks: ~
|
synapse_container_networks: ~
|
||||||
|
synapse_container_purge_networks: ~
|
||||||
synapse_container_dns_servers: ~
|
synapse_container_dns_servers: ~
|
||||||
synapse_container_etc_hosts: ~
|
synapse_container_etc_hosts: ~
|
||||||
synapse_container_memory: ~
|
synapse_container_memory: ~
|
||||||
|
@ -23,9 +23,8 @@ synapse_default_config: >-
|
|||||||
| combine(synapse_metrics_config)
|
| combine(synapse_metrics_config)
|
||||||
| combine(synapse_api_config)
|
| combine(synapse_api_config)
|
||||||
| combine(synapse_push_config)
|
| combine(synapse_push_config)
|
||||||
| combine(synapse_registration_config)
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
synapse_homeserver_config: >-
|
synapse_homeserver_config: >-
|
||||||
{{ synapse_default_config
|
{{ synapse_default_config
|
||||||
| combine(synapse_config | default({}), recursive=True) }}
|
| combine(synapse_config | default({})) }}
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
synapse_config_enable_registration: false
|
|
||||||
synapse_config_enable_registration_without_verification: false
|
|
||||||
synapse_config_registrations_require_3pid: []
|
|
||||||
synapse_config_registration_requires_token: true
|
|
||||||
synapse_config_registration_shared_secret: ~
|
|
||||||
synapse_config_registration_shared_secret_path: ~
|
|
||||||
synapse_config_allowed_local_3pids: []
|
|
||||||
synapse_config_enable_3pid_lookup: true
|
|
||||||
|
|
||||||
synapse_config_bcrypt_rounds: 14
|
|
||||||
synapse_config_allow_guest_access: false
|
|
||||||
synapse_config_default_identity_server: ~
|
|
||||||
synapse_config_enable_set_displayname: true
|
|
||||||
synapse_config_enable_set_avatar_url: true
|
|
||||||
synapse_config_enable_3pid_changes: true
|
|
||||||
|
|
||||||
synapse_registration_base_config:
|
|
||||||
enable_set_displayname: "{{ synapse_config_enable_set_displayname }}"
|
|
||||||
enable_set_avatar_url: "{{ synapse_config_enable_set_avatar_url }}"
|
|
||||||
enable_3pid_changes: "{{ synapse_config_enable_3pid_changes }}"
|
|
||||||
allow_guest_access: "{{ synapse_config_allow_guest_access }}"
|
|
||||||
enable_registration: "{{ synapse_config_enable_registration }}"
|
|
||||||
enable_registration_without_verification: >-2
|
|
||||||
{{ synapse_config_enable_registration_without_verification }}
|
|
||||||
allowed_local_3pids: "{{ synapse_config_allowed_local_3pids }}"
|
|
||||||
enable_3pid_lookup: "{{ synapse_config_enable_3pid_lookup }}"
|
|
||||||
registrations_require_3pid: "{{ synapse_config_registrations_require_3pid }}"
|
|
||||||
registration_requires_token: "{{ synapse_config_registration_requires_token }}"
|
|
||||||
registration_shared_secret: "{{ synapse_config_registration_shared_secret }}"
|
|
||||||
registration_shared_secret_path: >-2
|
|
||||||
{{ synapse_config_registration_shared_secret_path }}
|
|
||||||
bcrypt_rounds: "{{ synapse_config_bcrypt_rounds }}"
|
|
||||||
|
|
||||||
synapse_registration_config: >-2
|
|
||||||
{{
|
|
||||||
synapse_registration_base_config
|
|
||||||
| combine(({"default_identity_server": synapse_config_default_identity_server})
|
|
||||||
if (synapse_config_default_identity_server | default(false, true)
|
|
||||||
and synapse_config_default_identity_server | length > 0) else {})
|
|
||||||
}}
|
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
synapse_user: synapse
|
synapse_user: synapse
|
||||||
synapse_group: synapse
|
synapse_group: synapse
|
||||||
synapse_version: "1.128.0"
|
synapse_version: "1.116.0"
|
||||||
synapse_state: "present"
|
synapse_state: "present"
|
||||||
synapse_deployment_method: "docker"
|
synapse_deployment_method: "docker"
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
msg: "Required variable '{{ item }}' is undefined!"
|
msg: "Required variable '{{ item }}' is undefined!"
|
||||||
loop: "{{ synapse_required_variables }}"
|
loop: "{{ synapse_required_variables }}"
|
||||||
when: >-2
|
when: >-2
|
||||||
item not in hostvars[inventory_hostname]
|
item not in hostvars[ansible_host]
|
||||||
or hostvars[inventory_hostname][item] | length == 0
|
or hostvars[ansible_host][item] | length == 0
|
||||||
|
|
||||||
- name: Ensure conditionally required variables are given
|
- name: Ensure conditionally required variables are given
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
@ -28,5 +28,5 @@
|
|||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
when: >-2
|
when: >-2
|
||||||
item.when
|
item.when
|
||||||
and (item.name not in hostvars[inventory_hostname]
|
and (item.name not in hostvars[ansible_host]
|
||||||
or hostvars[inventory_hostname][item.name] | length == 0)
|
or hostvars[ansible_host][item.name] | length == 0)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
ulimits: "{{ synapse_container_ulimits | default(omit, true) }}"
|
ulimits: "{{ synapse_container_ulimits | default(omit, true) }}"
|
||||||
volumes: "{{ synapse_container_all_volumes }}"
|
volumes: "{{ synapse_container_all_volumes }}"
|
||||||
networks: "{{ synapse_container_networks | default(omit, true) }}"
|
networks: "{{ synapse_container_networks | default(omit, true) }}"
|
||||||
|
purge_networks: "{{ synapse_container_purge_networks | default(omit, true) }}"
|
||||||
dns_servers: "{{ synapse_container_dns_servers | default(omit, true) }}"
|
dns_servers: "{{ synapse_container_dns_servers | default(omit, true) }}"
|
||||||
etc_hosts: "{{ synapse_container_etc_hosts | default(omit, true) }}"
|
etc_hosts: "{{ synapse_container_etc_hosts | default(omit, true) }}"
|
||||||
memory: "{{ synapse_container_memory | default(omit, true) }}"
|
memory: "{{ synapse_container_memory | default(omit, true) }}"
|
||||||
|
Reference in New Issue
Block a user