Commit Graph
132 Commits
Author SHA1 Message Date
evangelostsak 3aca193de4 test(svc-net-wireguard): mark nodes as containers for autodetect
Infinito's DOCKER_IN_CONTAINER derives from the `container` env var,
which plain Docker (unlike systemd/podman) does not set, so the nodes
misdetected as bare metal: the constructor ran the host-only timezone
task (needs hwclock) and sys-svc-container would take the non-DinD path.
Boot nodes with -e container=docker so autodetect is correct.
2026-07-09 13:47:46 +02:00
evangelostsak 3139c63876 test(svc-net-wireguard): deploy with local connection
The deploy runs on the target node itself, but ansible defaulted to SSH
and failed UNREACHABLE (Connection refused, no sshd). Force
ansible_connection=local via extra-var so the role applies locally.
2026-07-09 13:47:46 +02:00
evangelostsak 1e95fb8033 test(svc-net-wireguard): pass vault password file to deploy
provision auto-creates a random vault password at <inv>/.password and
encrypts ansible_become_password with it. deploy dedicated does not
default to it, so rendering become_pass failed. Pass --password-file
<inv>/.password (node-local, written by provision) to the deploy.
2026-07-09 13:47:46 +02:00
evangelostsak b93bd594c9 test(svc-net-wireguard): give each node its own repo copy
The shared bind-mount let make install state (.env, venv stamps) leak
across nodes, so only the first nodes ran the real install and the rest
short-circuited with no venv (no infinito venv python). Mount the repo
read-only as -src and tar-copy it (excluding .git) into a node-local
/opt/src/infinito per node, so every node runs a full, independent
install. Aligns with the per-node-inventory design.
2026-07-09 13:47:46 +02:00
evangelostsak 43b533ff3c test(svc-net-wireguard): glob venv python path + diagnose on miss
server1 resolved /opt/venvs/infinito/bin/python but a later node did
not, so the venv lands at a different path/name there. Glob the common
venv parents (/opt/venvs/*, /root/.venvs/*, $HOME/.venvs/*) instead of
two fixed paths, and on a miss dump the existing venv dirs + .env venv
lines so the real location is visible in CI.
2026-07-09 13:47:46 +02:00
evangelostsak bdc8d5b34a test(svc-net-wireguard): resolve venv python by explicit path
load.sh's PYTHON resolver silently falls back to the system python3
(missing install deps -> ModuleNotFoundError: ruamel) when it cannot
confirm the venv, which happened on later nodes once server1 generated
the shared .env. Pin /opt/venvs/infinito/bin/python (or the HOME venv)
explicitly and fail loudly if absent, for both provision and deploy.
2026-07-09 13:47:46 +02:00
evangelostsak d4f351fcd5 test(svc-net-wireguard): invoke CLI via venv python -m cli
The `infinito` console script was not reliably on PATH across distros
(found on debian, missing on centos). Call the venv "$PYTHON" -m cli
from the repo root instead — deterministic, no console-script/PATH
dependency, and the venv python carries the install deps.
2026-07-09 13:47:46 +02:00
evangelostsak a27a06c32f test(svc-net-wireguard): run CLI via venv entrypoint, not bare python3
Bare `python3 -m cli` used the system interpreter, missing make install's
venv deps (ModuleNotFoundError: ruamel). Source scripts/meta/env/load.sh
to put /opt/venvs/infinito/bin on PATH and call the `infinito` console
script for provision + deploy.
2026-07-09 13:47:46 +02:00
evangelostsak 03d4a176c1 test(svc-net-wireguard): --allowerasing for centos prereqs
CentOS Stream 9 ships curl-minimal; installing curl conflicts with it.
dnf --allowerasing lets it swap curl-minimal for curl cleanly.
2026-07-09 13:47:46 +02:00
evangelostsak d801fa05b7 test(svc-net-wireguard): let deploy install docker engine, not bootstrap
make install ships only the docker CLI, not the engine, so the manual
`dockerd` start in 01_bootstrap failed with `dockerd: not found`. The
deploy installs + starts the engine itself via sys-svc-container
(DinD-aware), so bootstrap now just boots nodes + make install.
2026-07-09 13:47:46 +02:00
evangelostsak c1523d9044 test(svc-net-wireguard): surface dockerd startup failure + use vfs storage
make install now succeeds; the inner dockerd would not come up. Start it with --storage-driver=vfs (nested-friendly) and dump /tmp/dockerd.log on failure so the real cause is visible in CI.
2026-07-09 13:47:46 +02:00
evangelostsak ba82180033 test(svc-net-wireguard): install bootstrap prerequisites before make install
Raw debian/manjaro/centos base images have no make/git/python, so 'make install' failed with 'make: not found'. Install per-distro prerequisites first (apt/pacman/dnf).
2026-07-09 13:47:46 +02:00
evangelostsak 5eee13bb5f test(svc-net-wireguard): fail hard, never hang the e2e harness
Wrap make install / inventory provision / deploy dedicated in timeouts with stdin from /dev/null and non-interactive env, and cap the connectivity check at 180s. A stuck step now fails the harness fast instead of hanging the CI job.
2026-07-09 13:47:46 +02:00
evangelostsak 2f4ea68d14 test(svc-net-wireguard): rewrite e2e as deploy-driven full mesh
Replaces the linuxserver-image harness with a deploy-driven one: 01_bootstrap (6 empty containers + make install + DinD), 02_registration (per-host dedicated inventory via 'inventory provision' + full-mesh wg0.conf), 03_handshake ('deploy dedicated --id svc-net-wireguard' per host + all-pairs check). Adds the role's inventory-driven config path (mounts a per-host wg0.conf). NAT-flavor coverage follows once the mesh is green.
2026-07-09 13:47:46 +02:00
evangelostsak e242a28876 feat(svc-net-wireguard): flavor model, central subnet, NAT-on-host, beta lifecycle
Replaces mode+nat with a flavor list [server|client|nat]; declares the WireGuard internal subnet in group_vars/all/08_networks.yml; makes the masquerade task idempotent and applied on the deployed host (drops the DOCKER_IN_CONTAINER gate); bumps svc-net-wireguard and test-e2e-cli to lifecycle beta. (Revision 2 of req 026, PR #323 review.)
2026-07-09 13:47:46 +02:00
evangelostsak b97d1a5fc6 fix(svc-net-wireguard): let Docker auto-assign the NAT gateway upstream IP
Pinning the gateway to 10.30.30.1 collided with the docker-reserved subnet gateway address (Address already in use). The source-based masquerade does not need a fixed IP, so let docker assign it.
2026-07-09 13:47:46 +02:00
evangelostsak 865b4cb7c2 docs(026): tick client-mode + NAT criteria (validated by nat.sh)
Client mode (MTU 1400) and the NAT masquerade rules are now covered by the nat.sh e2e stage. Documents how NAT is tested and that the host-level task stays container-gated. Awaiting fork-CI confirmation of nat.sh.
2026-07-09 13:47:46 +02:00
evangelostsak f830424d19 test(svc-net-wireguard): add client-mode + NAT masquerade e2e stage
nat.sh brings up a WireGuard client (MTU 1400) behind a masquerading gateway and verifies it reaches an upstream host only via the masquerade, plus rule present/absent assertions. Wired into test.sh after mesh.sh.
2026-07-09 13:47:46 +02:00
evangelostsak f99a0f87d9 style(svc-net-wireguard): trim verbose comments from harness and vars 2026-07-09 13:47:45 +02:00
evangelostsak bb04818026 fix(svc-net-wireguard): use /tmp/wg for mesh keys/conf instead of /etc/wireguard
On the linuxserver Alpine image /etc/wireguard is a dangling symlink when the s6 init is bypassed (--entrypoint sleep), so key generation failed. Use a plain /tmp/wg workdir and 'wg-quick up /tmp/wg/wg0.conf' on every node.
2026-07-09 13:47:45 +02:00
evangelostsak b35545fc24 fix(svc-net-wireguard): install ping via apk on the Alpine server mesh nodes
linuxserver/wireguard is Alpine-based; the server-kind install used apt-get and exited 127. Use apk (iputils-ping, falling back to iputils).
2026-07-09 13:47:45 +02:00
evangelostsak a24d3a9b32 fix(svc-net-wireguard): make e2e peer handshake reliable in DinD
The server-generated peer config has AllowedIPs=0.0.0.0/0, which routes the endpoint through the tunnel and deadlocks the handshake, and WireGuard never initiates without traffic. external.sh now narrows AllowedIPs to the server tunnel subnet, adds PersistentKeepalive, and pings the server tunnel IP to trigger the handshake.
2026-07-09 13:47:45 +02:00
evangelostsak c6b20352dc refactor(svc-net-wireguard): move e2e harness to the test-e2e-cli contract
tests/ -> files/test/ (test.sh/local.sh/external.sh/mesh.sh) + templates/test.env.j2 (the test-e2e-cli discovery marker). README and requirement 026 updated to the adopted contract.
2026-07-09 13:47:45 +02:00
evangelostsak 7165f17a14 fix(svc-net-wireguard): drop host port publish from e2e server stack
The deployed role already binds the host WireGuard port; the e2e servers are reached by container name over the compose network, so publishing host ports only caused a 'port is already allocated' collision.
2026-07-09 13:47:45 +02:00
evangelostsak 50f39f918b fix(svc-net-wireguard): make e2e harness work under the deploy wrappers
local.sh used docker-style 'compose -f … -p …'; the repo compose wrapper takes --chdir/--project. e2e.sh now disables CA injection so 'container run' stays a plain passthrough (the CA path drops --device/--sysctl).
2026-07-09 13:47:45 +02:00
evangelostsak 1f6fe72288 chore(svc-net-wireguard): set role author to Evangelos Tsakoudis 2026-07-09 13:47:45 +02:00
evangelostsak 91000d2243 docs(svc-net-wireguard): document automatic CI e2e-cli discovery 2026-07-09 13:47:45 +02:00
evangelostsak 8f13d4e964 fix(svc-net-wireguard): move subnet to 192.168.205.0/24
192.168.204.0/24 now collides with web-app-seaweedfs from upstream.
2026-07-09 13:47:45 +02:00
evangelostsak ffffaf73a1 docs(svc-net-wireguard): add role README and Administration 2026-07-09 13:47:45 +02:00
evangelostsak b3842a92d3 test(svc-net-wireguard): add DinD server and full-mesh e2e harness 2026-07-09 13:47:45 +02:00
evangelostsak 5679326bb4 feat(svc-net-wireguard): add mode dispatch tasks and compose templates 2026-07-09 13:47:45 +02:00
evangelostsak 3cd7a8b69f feat(svc-net-wireguard): add Docker role meta and vars 2026-07-09 13:47:45 +02:00