From 8aaf0a81ed01ae661b0bbf6f5f610623182f540d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 2 Dec 2025 14:50:33 -0800 Subject: [PATCH] Add matrix config support to statusbot deployment The statusbot bot has grown support for talking to matrix in addition to IRC. Add support in our configuration management to configure the necessary settings to have the bot connect to matrix. Note that reviewers should double check that private vars are updated before approving this change. Change-Id: I20b28a1816821b6a6cc34c677b941ef32e08faa0 --- inventory/service/group_vars/eavesdrop.yaml | 6 ++++++ playbooks/roles/statusbot/tasks/main.yaml | 1 + playbooks/roles/statusbot/templates/statusbot.config.j2 | 8 ++++++++ playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2 | 7 +++++++ 4 files changed, 22 insertions(+) diff --git a/inventory/service/group_vars/eavesdrop.yaml b/inventory/service/group_vars/eavesdrop.yaml index 412ccd0207..333cead891 100644 --- a/inventory/service/group_vars/eavesdrop.yaml +++ b/inventory/service/group_vars/eavesdrop.yaml @@ -195,5 +195,11 @@ statusbot_auth_nicks: - ianw - frickler - tonyb +statusbot_matrix_rooms: + - '#opendev:opendev.org' + - '#zuul:opendev.org' +statusbot_matrix_auth_users: + - '@clarkb:matrix.org' + - '@jim:acmegating.com' gerritbot_gid: 11000 gerritbot_uid: 11000 diff --git a/playbooks/roles/statusbot/tasks/main.yaml b/playbooks/roles/statusbot/tasks/main.yaml index d728b5edd7..e1be68068e 100644 --- a/playbooks/roles/statusbot/tasks/main.yaml +++ b/playbooks/roles/statusbot/tasks/main.yaml @@ -11,6 +11,7 @@ - /var/log/statusbot - /var/lib/statusbot - /var/lib/statusbot/www + - /var/lib/statusbot/data - name: Put statusbot config in place template: diff --git a/playbooks/roles/statusbot/templates/statusbot.config.j2 b/playbooks/roles/statusbot/templates/statusbot.config.j2 index 22cfd30e84..3593c80596 100644 --- a/playbooks/roles/statusbot/templates/statusbot.config.j2 +++ b/playbooks/roles/statusbot/templates/statusbot.config.j2 @@ -10,6 +10,14 @@ nicks={{ statusbot_auth_nicks | join(',') }} lockfile=/var/run/statusbot/statusbot.pid log_config=/etc/statusbot/logging.config +[matrixbot] +user_id={{ statusbot_matrix_user }} +password={{ statusbot_matrix_password }} +homeserver={{ statusbot_matrix_homeserver }} +data_dir=/var/lib/statusbot/data +rooms={{ statusbot_matrix_rooms | join(',') }} +users={{ statusbot_matrix_auth_users | join(',') }} + [wiki] username={{ statusbot_wiki_user }} password={{ statusbot_wiki_password }} diff --git a/playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2 b/playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2 index 5067bc09ca..bca9d2fa18 100644 --- a/playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2 +++ b/playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2 @@ -60,3 +60,10 @@ limnoria_oftc_channels: ptgbot_channels: - '#opendev-sandbox' matrix_logs_password: password +statusbot_matrix_user: '@status_{{ 100 | random }}' +statusbot_matrix_homeserver: 'https://opendev.ems.host' +statusbot_matrix_password: password +statusbot_matrix_auth_users: + - '@testonly:opendev.org' +statusbot_matrix_rooms: + - '#test:opendev.org'