feat: an HA pair's DHCP peers and config sync as facts (4.11.0) #42

Merged
christianmanivong merged 1 commits from feat/dhcp-ha-config-sync into main 2026-10-16 13:22:28 +00:00
Owner

Two facts an HA pair reports about itself. netOrk groups service instances into one service with them (NetOrk/netork#1125).

  • get_dhcp_ha(): declared on DhcpServerMixin and optional (callable(getattr(...))). It returns what the DHCP server's own HA configuration says:
    • whether HA is on (enabled);
    • which peer this server is (this_server);
    • each peer's name, its role as the server words it (data, not a shared vocabulary), and its url where the server has one;
    • service, the name get_services reports for the server, so the caller can match the reading to its service.
  • ConfigSyncMixin.get_config_sync(): where the host pushes its configuration (peer, None for no one) and for which services, by get_services name. Sync items the driver has no service name for stay visible under unmapped. It is declaration only; a driver mixes it in and no role promises it.

Both getters raise when they could not read; neither answers "off" for "could not ask". Configuration, not state: whether a pair is in hot standby right now is not in here.

Shape reviewed against STRUCTURE.md (#37) with the #1105 session: facts in the driver, mode and warnings in netOrk, NotRequired where a future driver may not supply a field.

Version 4.11.0. This collides with #40, which also takes 4.11.0; whichever merges second moves to 4.12.0.

Tests: tests/test_dhcp_ha_config_sync.py. Full suite: 628 passed.

Two facts an HA pair reports about itself. netOrk groups service instances into one service with them (NetOrk/netork#1125). - **`get_dhcp_ha()`**: declared on `DhcpServerMixin` and optional (`callable(getattr(...))`). It returns what the DHCP server's own HA configuration says: - whether HA is on (`enabled`); - which peer this server is (`this_server`); - each peer's `name`, its `role` as the server words it (data, not a shared vocabulary), and its `url` where the server has one; - `service`, the name `get_services` reports for the server, so the caller can match the reading to its service. - **`ConfigSyncMixin.get_config_sync()`**: where the host pushes its configuration (`peer`, None for no one) and for which `services`, by `get_services` name. Sync items the driver has no service name for stay visible under `unmapped`. It is declaration only; a driver mixes it in and no role promises it. Both getters raise when they could not read; neither answers "off" for "could not ask". Configuration, not state: whether a pair is in hot standby right now is not in here. Shape reviewed against STRUCTURE.md (#37) with the #1105 session: facts in the driver, mode and warnings in netOrk, `NotRequired` where a future driver may not supply a field. Version 4.11.0. This collides with #40, which also takes 4.11.0; whichever merges second moves to 4.12.0. Tests: `tests/test_dhcp_ha_config_sync.py`. Full suite: 628 passed.
christianmanivong added 1 commit 2026-10-16 13:18:35 +00:00
feat: an HA pair's DHCP peers and config sync as facts (4.11.0)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 27s
CI / test (3.13) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.11) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.13) (pull_request) Successful in 25s
90367c1370
get_dhcp_ha (declared on DhcpServerMixin, optional) is what a DHCP
server's own HA configuration says: on or off, this server's peer name,
each peer's name, role as the server words it, and HA URL.
ConfigSyncMixin.get_config_sync is where a host pushes its configuration
and for which services, by the names get_services reports; sync items
without a service name stay visible under `unmapped`. A driver mixes it
in, no role promises it. Both raise when they could not read.

What the facts mean for a pair -- hot standby, which side to write to --
is the caller's (NetOrk/netork#1125).
christianmanivong merged commit 07b50f6a48 into main 2026-10-16 13:22:28 +00:00
christianmanivong deleted branch feat/dhcp-ha-config-sync 2026-10-16 13:22:28 +00:00
Sign in to join this conversation.