Create each Site's network with its own subnet

The deploy failed on hngmohali with 'all predefined address pools have been
fully subnetted': every 172.17-172.30/16 is in use, 172.31/16 is the host's own
VPC so Docker will not allocate from it, and all sixteen 192.168.0-240/20 blocks
are taken. Docker therefore refuses a network created without a subnet.

Each Site now names a free network_subnet (10.210.0.0/16, one /24 each), the role
looks the network up first and only creates it when it is absent and with that
subnet, and it fails with an explanation when a Site declares none. Existing
networks are left alone, because Docker cannot change a subnet in place and the
Sites already running have theirs. The test checks every Site declares one, and
the deployment readme says a new Site needs a free subnet.

deploy.sh now deploys every Site by default, with SITE=<name> to narrow it, which
is what the local edit was reaching for.
This commit is contained in:
tanshu committed 2026-09-23 00:18:04 +05:30
1 parent 33a8d56e8b
commit 01ce0bd609
8 files changed
+52 -5

No files matched your search

+2
View File
@@ -52,6 +52,8 @@ describe('every Site in the inventory is complete', () => {
assert.match(varsRaw, /^title: /m, `${name}: ${varFile} has no title`);
assert.match(varsRaw, /^host: 'menu\.\{\{ title \}\}'/m, `${name}: host is not quoted`);
assert.match(varsRaw, /^app_root: /m, `${name}: no app_root`);
// Without this the play fails on a host whose Docker pools are full.
assert.match(varsRaw, /^network_subnet: /m, `${name}: no network_subnet`);
}
});