No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott 60569ae621
All checks were successful
ci / lint (push) Successful in 10s
ci / sanity (push) Successful in 14s
ci / build (push) Successful in 1s
ci / units (push) Successful in 6s
release / release (push) Successful in 2s
ci / molecule (push) Successful in 2m32s
belowtoxic.hetzner 0.4.1: hcloud_server fixes from the first real run
- Adopted primary IPs are renamed through the API (hetzner.hcloud.primary_ip
  finds an IP by ID but never renames it) and read back by ID. Before, the
  addresses came back empty and a Flatcar server's Ignition config got
  Address=/64 (no IPv6).
- The server is created only when every planned address is known.
- Check mode works for a server whose firewall or IPs do not exist yet:
  IPs by ID, no firewall reference while it is only planned, no volume
  attachment or reverse DNS for a server that does not exist yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4g65L7UnUVqHmQp7kG
2026-11-28 16:35:53 +00:00
.forgejo/workflows belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
changelogs belowtoxic.hetzner 0.4.1: hcloud_server fixes from the first real run 2026-11-28 16:35:53 +00:00
extensions/molecule belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
meta belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
plugins belowtoxic.hetzner 0.4.0: Robot firewall 2026-11-27 19:05:23 +00:00
roles belowtoxic.hetzner 0.4.1: hcloud_server fixes from the first real run 2026-11-28 16:35:53 +00:00
tests/unit/plugins belowtoxic.hetzner 0.4.0: Robot firewall 2026-11-27 19:05:23 +00:00
.ansible-lint belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
.copier-answers.yml belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
.gitignore belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
.gitleaks.toml belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
.pre-commit-config.yaml belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
.yamllint belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
CHANGELOG.md belowtoxic.hetzner 0.4.1: hcloud_server fixes from the first real run 2026-11-28 16:35:53 +00:00
CONTRIBUTING.md belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
galaxy.yml belowtoxic.hetzner 0.4.1: hcloud_server fixes from the first real run 2026-11-28 16:35:53 +00:00
LICENSE belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
README.md belowtoxic.hetzner 0.4.0: Robot firewall 2026-11-27 19:05:23 +00:00
requirements.yml belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
ruff.toml belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00
SECURITY.md belowtoxic.hetzner 0.1.0: dedicated server bootstrap and Hetzner APIs 2026-11-22 23:42:06 +00:00

belowtoxic.hetzner

Hetzner-specific building blocks:

  • reinstalling dedicated servers from the rescue system - with a guard that refuses to wipe anything without explicit per-server confirmation;
  • the network facts of a dedicated server (main IP, /64, additional IPs with virtual MACs, subnets) from the Robot API - the source of truth the network roles check guest addresses against;
  • cloud servers with a firewall built from the same exposure rules the guests use.

Part of belowtoxic-ansible.

Content

Name Type Purpose
belowtoxic.hetzner.robot_bootstrap role rescue → installimage → reboot, guarded (DESTRUCTIVE)
belowtoxic.hetzner.robot_firewall role Robot firewall (stateless, 10 rules) from allowed services; budget checked before the API call
belowtoxic.hetzner.robot_firewall_rules filter allowed services → Robot firewall rules (per IP version, ICMP, return traffic)
belowtoxic.hetzner.hcloud_server role cloud server, firewall, rDNS
belowtoxic.hetzner.robot_network_info module normalised addresses of a dedicated server
belowtoxic.hetzner.blockdevices filter installable disks from lsblk --json --bytes
belowtoxic.hetzner.installimage_config filter installimage config: disk choice, RAID level, LVM layout

Disk layout chosen by installimage_config

Disks of (nearly) equal size and kind form groups; an SSD group beats an HDD group (prefer_ssd), then the most usable capacity wins.

Disks in the group RAID
1 none
2-3 1
4, 6, 8, ... 10
5, 7, ... 6

Partitions: ESP (UEFI only), /boot (1 GiB), one LVM PV in volume group vg0 with root (64 GiB) and swap (RAM/4, 4-16 GiB). The rest of vg0 stays free for guest disks. Everything is overridable via robot_bootstrap_layout.

Bootstrapping a dedicated server

With the bootstrap_dedicated playbook of the infrastructure repository:

# dry run: rescue system + /root/installimage.conf, nothing is installed
ansible-playbook playbooks/bootstrap_dedicated.yml -l hv1 \
  -e robot_bootstrap_confirm=<server number> -e robot_bootstrap_dry_run=true
# the real thing
ansible-playbook playbooks/bootstrap_dedicated.yml -l hv1 -e robot_bootstrap_confirm=<server number>

Without robot_bootstrap_confirm equal to the server number the role stops before touching the server.

Testing

  • Unit tests for the filters (NVMe, SATA, 4Kn, mixed SSD/HDD, RAID levels) and the Robot module (recorded API shapes, documentation addresses).
  • extensions/molecule/bootstrap runs robot_bootstrap against a VM that plays the rescue system (stub installimage): guard, disk discovery, configuration, install, reboot and verification - everything except the Robot API calls and the actual wipe.

License

GPL-3.0-or-later, see LICENSE.