Files
Kamino/roles/network_interfaces/meta/argument_specs.yml
T
Defame1297andClaude Sonnet 5.5 cf8f4b5bf0
Build / build (pull_request) Successful in 10s
Lint / lint (pull_request) Successful in 17s
Molecule / molecule (pull_request) Successful in 4m43s
feat(roles): add the systemd_hardening and network_interfaces roles
Copied from the environment repository's roles and scrubbed for the
Collection: galaxy namespace mortis, molecule scenarios call the roles by
their FQCN and take their paths from the workflow, README examples use
mortis.kamino.* and documentation addresses, repository-local references
(issue numbers, ADRs, inventory paths) are dropped. network_interfaces
loses its Legacy name guard and the molecule play that tested it: the
guard only protected the in-repo rename, and a new consumer never had the
old names. mock_roles in .ansible-lint lists both FQCNs.

Not verified locally: the molecule scenarios (they run on the
kamino-molecule runner in CI) and ansible-test sanity.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-10 15:09:48 +00:00

81 lines
3.6 KiB
YAML

---
argument_specs:
main:
short_description: Manage /etc/network/interfaces
description:
- >-
Reads the interfaces file, renders it from C(network_interfaces_layout), and when the content differs backs up the current file, writes the new
one, validates it and reloads. A failed validation restores the backup and fails the play.
- Needs C(ifupdown2), because validation and reload use C(ifreload).
options:
network_interfaces_layout:
type: dict
default: {manual: [], bridges: []}
description:
- >-
Desired network layout. The file is fully replaced with a loopback stanza, one C(iface <name> inet manual) per C(manual) entry and one
stanza per bridge. Both keys are optional when the variable is set.
options:
manual:
type: list
elements: str
description: Interface names configured as C(inet manual), without C(auto).
bridges:
type: list
elements: dict
description: Bridges, rendered in order with C(auto <name>).
options:
name:
type: str
required: true
description: Bridge name, for example C(vmbr0).
method:
type: str
description: Address method. The template default is C(manual). With C(static), C(address) and C(netmask) are read unconditionally.
address:
type: raw
description: >-
IP address, only used when C(method) is C(static). Typed raw so that an inventory can template it, for
example from C(ansible_host).
netmask:
type: str
description: Netmask, only used when C(method) is C(static).
gateway:
type: str
description: Default gateway, only used when C(method) is C(static) and the key is present.
ports:
type: str
description: Value of C(bridge_ports). The template default is C(none).
stp:
type: str
description: Value of C(bridge_stp). The template default is C(off). Quote C("off"), because unquoted YAML turns it into a boolean.
fd:
type: raw
description: Value of C(bridge_fd), written only when C(stp) is not C(off). The template default is 2.
vlan_aware:
type: bool
description: Adds C(bridge_vlan_aware yes) and C(bridge_vids). The template default is false.
vlan_ids:
type: str
description: Value of C(bridge_vids) when C(vlan_aware) is true. The template default is C(2-4094).
network_interfaces_file:
type: path
default: /etc/network/interfaces
description:
- File that is read, compared and rewritten.
network_interfaces_backup:
type: path
default: /etc/network/interfaces.bak
description:
- Where the current file is copied before it is replaced, and restored from when validation fails.
network_interfaces_validate_command:
type: str
default: ifreload -s -a
description:
- Command run after the new file is written, in syntax-check mode. A failure triggers the restore.
network_interfaces_apply_command:
type: str
default: ifreload -a
description:
- Command run by the C(Reload Interfaces) handler, which the role flushes right after validation.