Commit Graph
86 Commits
Author SHA1 Message Date
Slavi PantaleevandClaude Opus 5 c447e1528b Reword the Molecule scenario comments
They were hard-wrapped at 80 characters, broke mid-parenthesis, and spent lines
restating what the code below them does.

Rewrapped at natural boundaries instead, with the narration dropped and only the
reasons, gotchas and surprises kept. Section dividers stay - they delineate long
plays rather than narrate them.

Comments only; no scenario behaviour changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEH3vxYSQ5SV4N5z61eyGT
2026-08-27 18:02:53 +03:00
Slavi PantaleevandClaude Opus 5 705f561777 Give each Molecule scenario its own Ansible home
Scenarios install their Galaxy dependencies with `force: true`, so two roles
running at once re-extract the same collections and roles into ~/.ansible and
pull them out from under each other mid-play. It surfaces as a collection that
was working moments earlier going missing:

  the connection plugin 'community.docker.docker' was not found

Found while running five scenarios in parallel, where it cost a run.

ANSIBLE_HOME relocates both `collections/` and `roles/`, so one variable covers
both halves; the scenarios' ANSIBLE_ROLES_PATH workaround now follows it rather
than hardcoding ~/.ansible/roles. Left alone if already set, and unset in CI,
where each role runs in its own job and has nothing to collide with.

Verified by removing var/molecule-ansible-home entirely and running
matrix-alertmanager-receiver from cold: green through idempotence, with the
collections and roles landing under the per-role directory - which also shows
nothing was quietly relying on the shared ~/.ansible being populated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEH3vxYSQ5SV4N5z61eyGT
2026-08-27 18:02:53 +03:00
Slavi PantaleevandClaude Opus 5 6bdcddb79a Add a Molecule scenario for baibot, and teach the stub to answer a syncing client
baibot is the first bot rather than a bridge, and the shape
differs from the appservices: it is a plain Matrix client that logs in with a
password, sets up its profile and then syncs. It publishes no port, so nothing
can be probed over HTTP; what it says about itself in the journal is the only
window into whether the role's configuration reached the process.

What the scenario proves:

- The unit is active with no automatic restarts, AND baibot got past startup
  into its sync loop. The second half is what carries the scenario. baibot never
  exits when startup goes wrong - it retries the failing step forever with a
  growing delay - so the unit sits there `active` with `NRestarts` at 0 while
  the bot is permanently half-started. Pointing `user.avatar` at a file that is
  not there reproduces exactly that: the unit assertion still passes, the sync
  assertion does not.
- The display name the bot announces it wants is the role's `user.name`, which
  is neither the role's default nor what the stub reports the account already
  has.
- The rendered `logging` string took effect per target: baibot's own records
  appear at DEBUG (the role ships `info`) while everything underneath stays at
  the `warn` catch-all. The second half is the control, and raising the
  catch-all turns 2 DEBUG records into 161.
- The rendered config carries the scenario's homeserver, identity, command
  prefix, admin patterns and user patterns, and uses password authentication
  exclusively, with the access-token keys rendered as nulls.
- The statically-defined agent survived the provider templating - the
  per-provider template rendered to YAML, parsed, merged and nested into the
  list - key by key.
- The container runs as the uid/gid the playbook supplies (1234, not the 1000
  the base image already has), on the image version defaults/main.yml pins, and
  could write its session into the data path.

No AI provider is contacted and none is needed. baibot calls a provider only
when a message asks an agent to do something, so a static agent with a
placeholder key and a base URL that resolves nowhere still has to survive the
bot's startup parsing - which is the part worth testing.

The shared stub grew what a syncing Matrix client needs and an appservice did
not: /sync (with a `next_batch`, and holding the call open for the timeout the
client asked for, or the bot spins the stub in a hot loop), the media config
and upload endpoints a bot setting its own avatar insists on, /keys/upload with
its key counts, and filter creation. Without the media config in particular,
baibot never gets past profile setup.

The shared stub task gained a STUB_VERBOSE knob. The stub already advertised
the environment variable but there was no way to set it from a scenario, and
for a component with no port of its own its request log is the only place to
see what the component is actually asking for.

Note: molecule-shared/homeserver-stub.py also carries a loosened /login match
from another scenario being written in this same tree at the same time; it was
already in the working copy and is not mine.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEH3vxYSQ5SV4N5z61eyGT
2026-08-27 18:02:53 +03:00
Slavi PantaleevandClaude Opus 5 e5b8de8c2b Heal git checkout ownership in all roles cloning repositories on the server
6b4b7647e fixed this for synapse-usage-exporter only. A checkout owned by
a different user makes the git task fail from then on, either with a
permission error or with git's dubious-ownership protection, until
someone removes the directory on the host by hand. It gets into that
state when the matrix user's uid changes (a server migration or a restore
onto a differently numbered user), when an earlier clone ran as another
user, or when someone runs git as root inside the checkout.

Every other role cloning a repository onto the server was open to the
same failure, so ensure the checkout's ownership recursively before
updating it at the remaining 54 sites.

The three matrix-synapse ext clones also gain force=yes. They were the
only on-server clones without it, which left a checkout that an
interrupted run had half-written wedged, instead of repaired on the next
run.

matrix-matrixto used to clone as root into a directory that nothing ever
chowned, unlike every other role. It now becomes the matrix user too.

The Element Web and SchildiChat Web theme checkouts live on the Ansible
controller, where correcting ownership is not ours to do, so they merely
mark the checkout as a safe directory for git.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 19:01:52 +03:00
renovate[bot]andSlavi Pantaleev 693fbb08aa Update ghcr.io/etkecc/baibot Docker tag to v1.25.0 2026-06-29 19:26:12 +03:00
AineandSlavi Pantaleev d61979a0b9 baibot: add venice wiring 2026-06-28 19:50:08 +03:00
renovate[bot]andSlavi Pantaleev 682eb2c280 Update ghcr.io/etkecc/baibot Docker tag to v1.24.0 2026-06-26 17:30:34 +03:00
Aine 6f57ab8ba1 Baibot v1.23.1 <https://github.com/etkecc/baibot/blob/main/CHANGELOG.md#2026-06-24-version-1231> 2026-06-24 07:28:07 +01:00
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
e3b37ac350 Update ghcr.io/etkecc/baibot Docker tag to v1.23.0 (#5353)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-23 07:22:40 +01:00
renovate[bot]andSlavi Pantaleev 8b13017281 Update ghcr.io/etkecc/baibot Docker tag to v1.22.0 2026-06-21 09:10:18 +03:00
bd6e08a93e Allow host network mode for MDAD-managed containers (#5310)
* feat: support container_network=host across all roles + systemd templates

Mirror the pattern Slavi introduced for matrix-coturn (aafa8f0) across the
fork: every 'Ensure X container network is created' task gets a
'when: <var> not in ["", "host"]' guard so MDAD does not try to
docker_network create a network literally named 'host' (returns 403,
since host is a pre-defined Docker network).

Mirror the same guard in every systemd unit template that does
'ExecStartPre=docker network connect <addnet> <container>' loops over
matrix_<role>_container_additional_networks: skip the connects when the
container is on host networking (where additional --network attaches
are invalid).

Unblocks DiD setups where MDAD-managed containers share their host's
network namespace (matrix-mdad outer compose service joined to central
postgres/openldap networks) to reach external services on the outer
Docker daemon.

* Simplify container network guards (!= 'host') and fix duplicate when

Guarding on the empty string ('') as well was misleading: systemd unit
templates still render an unconditional --network= flag, so an empty
network value produces a broken docker create command. Only 'host' is
actually supported, so only guard on that. This also matches the
existing convention in the Traefik role
(when: traefik_container_network != 'host').

Also fix a duplicate when key in the meshtastic-relay role, where the
network-creation task already had a when condition - the two are now
combined into a list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 23:48:03 +03:00
renovate[bot]andSlavi Pantaleev 28165b5892 Update ghcr.io/etkecc/baibot Docker tag to v1.21.1 2026-06-05 13:16:27 +03:00
renovate[bot]andSlavi Pantaleev 551c802122 Update ghcr.io/etkecc/baibot Docker tag to v1.20.0 2026-06-03 00:06:29 +03:00
renovate[bot]andSlavi Pantaleev 27826e69ca Update ghcr.io/etkecc/baibot Docker tag to v1.19.3 2026-05-27 10:37:41 +03:00
renovate[bot]andSlavi Pantaleev d1e64c3ef2 Update ghcr.io/etkecc/baibot Docker tag to v1.19.2 2026-05-21 13:42:04 +03:00
renovate[bot]andSlavi Pantaleev 2247c56c23 Update ghcr.io/etkecc/baibot Docker tag to v1.19.1 2026-05-09 20:33:10 +03:00
Slavi PantaleevandClaude Opus 4.7 c82415cd7b matrix-bot-baibot: switch to modern community.docker docker_image modules
Replaces `community.docker.docker_image` with the modern
`docker_image_pull` and `docker_image_build` split modules. Drops the
`ansible_version` compatibility ladder and the now-redundant
`_container_image_force_pull` variable (the new pull module handles
registry refresh natively via `pull: always`). Also registers
`_container_image_build_result` so that a self-build rebuild correctly
triggers a service restart.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5191.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 21:40:37 +03:00
renovate[bot]andSlavi Pantaleev 1f3f02f0a7 chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.18.0 2026-04-11 13:35:05 +03:00
renovate[bot]andSlavi Pantaleev 8483683b28 chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.17.0 2026-03-26 01:38:32 +02:00
renovate[bot]andSlavi Pantaleev bea22b97fa chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.16.1 2026-03-24 18:35:55 +02:00
renovate[bot]andSlavi Pantaleev 5167507989 chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.16.0 2026-03-20 19:03:52 +02:00
Slavi Pantaleev d4e8da3e0a Bump default OpenAI text-generation model (gpt-5.2 -> gpt-5.4) 2026-03-11 10:05:46 +02:00
Slavi Pantaleev df205a2f77 Upgrade baibot (v1.14.3 -> v1.15.0) and adapt to support optional access-token auth mode
Ref:
- https://github.com/etkecc/baibot/pull/83
- https://github.com/etkecc/baibot/blob/748d2b7fd4ab7bbd53cde1400935d634dc13ea38/CHANGELOG.md#2026-03-07-version-1150
- https://github.com/etkecc/baibot/blob/748d2b7fd4ab7bbd53cde1400935d634dc13ea38/docs/configuration/authentication.md
2026-03-07 12:43:48 +02:00
renovate[bot]andSlavi Pantaleev dbe4b1db5f chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.14.3 2026-02-18 07:20:23 +02:00
QEDeDandSlavi Pantaleev f0f496b6ba Quote YAML mode values to satisfy octal lint rules 2026-02-16 13:19:10 +02:00
Slavi PantaleevandClaude Opus 4.6 16010ff8c7 Add conditional restart support to client, bot, and bridge roles
For each of the 34 roles (3 clients, 9 bots, 22 bridges), this commit:
- Adds `_restart_necessary: false` default variable
- Adds `register:` directives to config/image/systemd tasks
- Computes `_restart_necessary` via set_fact (OR of all .changed results)
- Wires `(_restart_necessary | bool)` in group_vars/matrix_servers

This allows the systemd service manager to skip unnecessary restarts
when running install-* tags and nothing actually changed.

Service roles and complex multi-service roles will follow separately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:33:54 +02:00
renovate[bot]andSlavi Pantaleev 7f04231904 chore(deps): update ghcr.io/etkecc/baibot docker tag to v1.14.1 2026-02-10 15:18:02 +02:00
Slavi Pantaleev 7d4536cf78 Upgrade baibot (v1.13.0 -> v1.14.0) and add built-in tools configuration support 2026-02-04 04:21:47 +02:00
Slavi Pantaleev 97c2915034 Upgrade baibot (v1.12.0 -> v1.13.0) 2026-01-23 00:52:36 +02:00
Slavi Pantaleev 66c85f63e6 Update default OpenAI image generation model for baibot (gpt-image-1 -> gpt-image-1.5) 2025-12-21 23:28:36 +02:00
Slavi Pantaleev 9ea18d6f2d Upgrade baibot (v1.11.0 -> v1.12.0) 2025-12-21 23:28:12 +02:00
Slavi Pantaleev 98331ae970 Upgrade baibot (v1.10.0 -> v1.11.0) and add support for configuring a custom avatar 2025-12-15 10:27:44 +02:00
Slavi Pantaleev fa3d05ea81 Bump OpenAI text-generation model for baibot (gpt-5.1 -> gpt-5.2) 2025-12-12 16:03:40 +02:00
Slavi Pantaleev 4238ec6e86 Upgrade baibot (v1.9.0 -> v1.10.0) 2025-12-06 07:12:48 +02:00
Slavi Pantaleev fb0a1bd489 Upgrade baibot (v1.8.3 -> v1.9.0) 2025-11-30 12:37:57 +02:00
Slavi Pantaleev eda41e89c1 Upgrade baibot (v1.8.2 -> v1.8.3) 2025-11-28 14:53:31 +02:00
Slavi Pantaleev b464f3cc55 Upgrade baibot (v1.8.1 -> v1.8.2) 2025-11-20 06:14:56 +02:00
Slavi Pantaleev 4b2919b538 Bump OpenAI text-generation model for baibot (gpt-5 -> gpt-5.1) 2025-11-18 06:24:08 +02:00
Slavi Pantaleev d05c83d0d5 Bump Anthropic text-generation model for baibot (claude-3-7-sonnet-20250219 -> claude-sonnet-4-5-20250929) 2025-11-18 06:23:47 +02:00
Slavi Pantaleev 24c2de23d5 Upgrade baibot (v1.8.0 -> v1.8.1) 2025-09-12 17:05:06 +03:00
Slavi Pantaleev beb8e6d5f9 Upgrade baibot (v1.7.6 -> v1.8.0) 2025-09-08 15:39:02 +03:00
Slavi Pantaleev 389118760f Change default OpenAI model for baibot (gpt-4.1 -> gpt-5)
Ref: https://openai.com/index/introducing-gpt-5/
2025-08-08 07:20:18 +03:00
Slavi Pantaleev 51ab9ed9ff Adjust lstrip_blocks to use a bool value for compatibility with ansible-core>=2.19.0
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4445
2025-07-26 17:58:12 +03:00
Slavi Pantaleev a1f6ee4dc9 Improve compatibility with ansible-core>=2.19.0 by not reaching into vars
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4445
2025-07-26 17:50:20 +03:00
Slavi Pantaleev 9e205d50ac Upgrade baibot (v1.7.5 -> v1.7.6) 2025-07-11 16:49:24 +03:00
Slavi Pantaleev 018f3f4408 Upgrade baibot (v1.7.4 -> v1.7.5) 2025-06-27 16:48:08 +03:00
Slavi Pantaleev e76b50a0b7 Upgrade baibot (v1.7.3 -> v1.7.4) 2025-06-10 16:40:02 +03:00
Slavi Pantaleev adef970239 Upgrade baibot (v1.7.2 -> v1.7.3) 2025-06-10 15:35:07 +03:00
Slavi Pantaleev b3cd3910a9 Default matrix_bot_baibot_config_agents_static_definitions_openai_config_image_generation_size to null
Ref: https://github.com/etkecc/baibot/blob/91986a129c146669d168d2bfcc830fb40ba8f4cb/CHANGELOG.md#2025-05-11-version-172
2025-05-11 23:22:02 +03:00
Slavi Pantaleev 89599d464a Upgrade baibot (v1.7.1 -> v1.7.2) 2025-05-11 23:21:52 +03:00