mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-06-25 10:47:51 +02:00
Add appservice-double-puppet service for better bridge double-puppeting
Bridges will be switched to this new method in future patches.
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
- name: Ensure matrix-appservice-double-puppet paths exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- path: "{{ matrix_appservice_double_puppet_base_path }}"
|
||||
when: true
|
||||
- path: "{{ matrix_appservice_double_puppet_config_path }}"
|
||||
when: true
|
||||
when: item.when | bool
|
||||
|
||||
- name: Ensure matrix-appservice-double-puppet registration configuration installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_appservice_double_puppet_registration_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_appservice_double_puppet_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
20
roles/custom/matrix-appservice-double-puppet/tasks/main.yml
Normal file
20
roles/custom/matrix-appservice-double-puppet/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-appservice-double-puppet
|
||||
- install-all
|
||||
- install-appservice-double-puppet
|
||||
block:
|
||||
- when: matrix_appservice_double_puppet_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_appservice_double_puppet_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-appservice-double-puppet
|
||||
block:
|
||||
- when: not matrix_appservice_double_puppet_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/uninstall.yml"
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Ensure matrix-appservice-double-puppet paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_appservice_double_puppet_base_path }}"
|
||||
state: absent
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Fail if required matrix-appservice-double-puppet settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- {'name': 'matrix_appservice_double_puppet_registration_as_token', when: true}
|
||||
- {'name': 'matrix_appservice_double_puppet_registration_as_token', when: true}
|
||||
- {'name': 'matrix_appservice_double_puppet_registration_sender_localpart', when: true}
|
Reference in New Issue
Block a user