From a508d2a069a11eb15bafeb73e2a38505dc89275f Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Wed, 19 Jun 2024 13:58:10 +0200 Subject: [PATCH] Make maubot automatically create its own user. --- docs/configuring-playbook-bot-maubot.md | 10 +++++++++- group_vars/matrix_servers | 6 ++++++ roles/custom/matrix-bot-maubot/defaults/main.yml | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/configuring-playbook-bot-maubot.md b/docs/configuring-playbook-bot-maubot.md index bf2b1d14b..a8c6dcb61 100644 --- a/docs/configuring-playbook-bot-maubot.md +++ b/docs/configuring-playbook-bot-maubot.md @@ -27,9 +27,17 @@ maubot administration interface. After configuring the playbook, run the [installation](installing.md) command again: ``` -ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start +ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-users-created,start ``` +**Notes**: + +- the `ensure-matrix-users-created` playbook tag makes the playbook automatically create the bot's user account + +- if you change the bot password (`matrix_bot_maubot_initial_password` in your `vars.yml` file) subsequently, + the bot user's credentials on the homeserver won't be updated automatically. + If you'd like to change the bot user's password, use a tool like [synapse-admin](configuring-playbook-synapse-admin.md) to change it. + ## Usage You can visit `matrix./_matrix/maubot/` to manage your available plugins, clients and instances. diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 284ed497a..f84bf4e55 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -5174,6 +5174,12 @@ matrix_user_creator_users_auto: | 'initial_password': matrix_bot_buscarron_password, 'initial_type': 'bot', }] if matrix_bot_buscarron_enabled else []) + + + ([{ + 'username': matrix_bot_maubot_login, + 'initial_password': matrix_bot_maubot_initial_password, + 'initial_type': 'bot', + }] if matrix_bot_maubot_enabled else []) }} ###################################################################### diff --git a/roles/custom/matrix-bot-maubot/defaults/main.yml b/roles/custom/matrix-bot-maubot/defaults/main.yml index 183ceabcb..c0b6ca519 100644 --- a/roles/custom/matrix-bot-maubot/defaults/main.yml +++ b/roles/custom/matrix-bot-maubot/defaults/main.yml @@ -5,6 +5,11 @@ matrix_bot_maubot_enabled: true +matrix_bot_maubot_login: bot.maubot +# This is just initial password and it will not manage subsequent password changes. +# Use a tool like synapse-admin if you need to change it. +matrix_bot_maubot_initial_password: "{{ lookup('password', '/dev/null', length=64 }}" + matrix_bot_maubot_scheme: https matrix_bot_maubot_hostname: '' matrix_bot_maubot_path_prefix: /_matrix/maubot