No description
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- 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 |
||
| .forgejo/workflows | ||
| changelogs | ||
| extensions/molecule | ||
| meta | ||
| plugins | ||
| roles | ||
| tests/unit/plugins | ||
| .ansible-lint | ||
| .copier-answers.yml | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .pre-commit-config.yaml | ||
| .yamllint | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| galaxy.yml | ||
| LICENSE | ||
| README.md | ||
| requirements.yml | ||
| ruff.toml | ||
| SECURITY.md | ||
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/bootstraprunsrobot_bootstrapagainst a VM that plays the rescue system (stubinstallimage): 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.