docs(roles): bring every role README to the fixed heading set
Build / build (pull_request) Successful in 27s
Molecule / molecule (pull_request) Successful in 4s
Lint / lint (pull_request) Successful in 1m21s

Every public role README has the headings Supported platforms, Requirements
and run order, Role variables, Entry points (when several), Variables set by
the role (when any), Tags, Example play, Tests and Notes, in that order, with
an "Idempotent" line in Notes. Role-specific sections move under Entry points
or Notes; nothing is removed. The internal _binary_update README keeps its own
headings and gains the platform and Idempotent lines.

Closes #136

Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
Defame1297 committed 2026-11-25 17:24:27 +00:00
1 parent 4a7189c067
commit 234648919c
14 files changed
+304 -91

No files matched your search

+20 -1
View File
@@ -4,13 +4,18 @@ Renders `/etc/network/interfaces` from a list of manual interfaces and bridges,
## Supported platforms
Debian-based hosts using `ifupdown2` (`ifreload`), such as Proxmox hosts. The molecule scenario (`molecule/default/`, CI only) runs on Ubuntu 24.04 without `ifupdown2`: the validate and reload commands are stubs, so it tests the rendered file, the backup, the single reload and the restore after a failing validation. It does not test `ifreload`, so no Debian release or `ifupdown2` version is verified by a test.
The role targets Debian-based hosts using `ifupdown2` (`ifreload`), such as Proxmox hosts. No platform it targets is verified by a test: the molecule scenario runs on Ubuntu 24.04 (noble) with stubs in place of `ifupdown2` (see [Tests](#tests)).
Untested platforms: Debian `all`, as declared in `meta/main.yml`.
It does not cover Ubuntu hosts: it writes the `ifupdown2` bridge configuration of a hypervisor.
## Requirements and run order
- `ifupdown2` must be installed, because the validate and apply commands call `ifreload`.
- Use it by its fully qualified name, `mortis.kamino.network_interfaces`.
- Run it with `serial: 1` and the most important host last, so a bad change is caught on another host first. It rewrites the host's network configuration, so run it before roles that depend on the network.
- Role dependencies: none.
- Gathered facts are not read. The tasks use `become` where they write.
- `network_interfaces_layout` normally comes from inventory (group_vars or host_vars), so each host can have its own layout.
@@ -50,9 +55,23 @@ None. The role does not tag its tasks, so only a play-level tag applies.
vlan_aware: true
```
## Tests
`molecule/default` runs in CI only, on one platform: Ubuntu 24.04 (noble), the `molecule-ubuntu2404` image (`${MOLECULE_IMAGE}`). The image has no `ifupdown2`, and a real reload could cut the container's own network, so the validate command is `/bin/true` and the apply command appends to a marker file; the rest of the role runs unchanged. Prepare seeds `/etc/network/interfaces` with a legacy body, so the converge has a change to make and a backup to take.
Verify checks:
- The rendered file holds the loopback, the manual interface and both bridges with their options (address, netmask, gateway, ports, STP, forward delay, VLAN awareness and `bridge_vids 2-4094`), and no legacy line is left.
- The backup holds the legacy body.
- The reload ran once across the converge and the idempotence run.
- With a failing validate command (`/bin/false`), the role fails with "Previous config restored", and the previous file is back.
It does not test `ifreload`, so no Debian release or `ifupdown2` version is verified by a test.
## Notes
- The template replaces the whole file: any stanza not described by `network_interfaces_layout` is dropped. Interfaces carried by other consumers (for example a bridge that carries a router VM's WAN) must be listed.
- Idempotent: yes.
- Only a content difference triggers work. Idempotent runs change nothing.
- On change the order is: copy the current file to `network_interfaces_backup`, write the new file (notifies `Reload Interfaces`), run the validate command, flush handlers. Any failure in that block restores the backup and fails with "Invalid network configuration detected. Previous config restored." The restore does not reload the interfaces.
- The validate command runs after the file is written, and the reload runs right after it. A configuration that passes validation but breaks connectivity is not detected.