mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-17 04:03:34 +03:00
Add matrix-user-creator role - automatic user account creation support
We no longer ask users to create Matrix user accounts for these bots: - Postmoogle - Honoroit - Reminder Bot Other bots and services (matrix-registration-bot, maubot, mjolnir, Dimension, etc.) require an Access Token to run (not a password), so this new role doesn't help for them. It does help for the above bots though, and for defining your own "initial user accounts" in the `matrix_user_creator_users_additional` variable.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Ensure Dendrite user registered - {{ user.username | quote }}
|
||||
ansible.builtin.command:
|
||||
cmd: |-
|
||||
{{ matrix_host_command_docker }} exec matrix-dendrite
|
||||
create-account
|
||||
-config /data/dendrite.yaml
|
||||
-username {{ user.username | quote }}
|
||||
-password {{ user.initial_password | quote }}
|
||||
{% if user.initial_type == 'admin' %}
|
||||
-admin
|
||||
{% endif %}
|
||||
-url http://localhost:{{ matrix_dendrite_http_bind_port }}
|
||||
register: matrix_dendrite_register_user_result
|
||||
changed_when: matrix_dendrite_register_user_result.rc == 0 and 'Desired user ID is already taken' not in matrix_dendrite_register_user_result.stderr
|
||||
failed_when: matrix_dendrite_register_user_result.rc != 0 and 'Desired user ID is already taken' not in matrix_dendrite_register_user_result.stderr
|
||||
Reference in New Issue
Block a user