extract-fw-host-vars.py: abort if a conf file cannot be read; add --from-dir. Migrate cl-test.

Previously an unreadable file (e.g. /etc/ipt-firewall is 0750 after the
role ran) silently produced almost empty host_vars. The script now exits
with an error and writes nothing. --from-dir reads the conf files from a
local directory, e.g. fetched with ansible using the vaulted become
password.

Add host_vars for cl-test.oopen.de (fw_manage_config: true).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 01:00:55 +01:00
co-authored by Claude Opus 5.5
parent ec62f54ab4
commit 3e6486c5b5
3 changed files with 83 additions and 13 deletions
@@ -0,0 +1,38 @@
---
# ipt-firewall configuration for cl-test.oopen.de
# Generated by extract-fw-host-vars.py - review before committing!
# Place in: host_vars/<hostname>/<short-hostname>-ipt-server.yml
fw_manage_config: true
# --- Network
fw_ext_interfaces:
- "eth0"
fw_ext_ips_v4:
- "159.69.74.143"
fw_ext_ips_v6:
- "2a01:4f8:231:19a7::143"
# --- Munin
munin_remote_ipv4: 37.27.121.227
munin_remote_ipv6: "2a01:4f9:3070:2bda::227"
# --- Access control IPv4
fw_allow_ext_service_v4: "159.69.74.156:3478:tcp 159.69.74.156:3478:udp 159.69.74.156:3479:tcp 159.69.74.156:3479:udp 159.69.74.156:5349:tcp 159.69.74.156:5350:udp"
fw_allow_local_service_from_networks_v4: "46.90.86.195:80:tcp 46.90.86.195:443:tcp"
# --- Access control IPv6
fw_allow_ext_service_v6: "2a01:4f8:231:19a7::156,3478,tcp 2a01:4f8:231:19a7::156,3478,udp 2a01:4f8:231:19a7::156,3479,tcp 2a01:4f8:231:19a7::156,3479,udp 2a01:4f8:231:19a7::156,5349,tcp 2a01:4f8:231:19a7::156,5349,udp 2a01:4f8:231:19a7::156,5350,tcp 2a01:4f8:231:19a7::156,5350,udp"
fw_allow_local_service_from_networks_v6: "2003:ec:df11:4400::/56,80,tcp 2003:ec:df11:4400::/56,443,tcp"
# --- HTTP
fw_http_server_ips: $ext_1_ip
# --- Mail
fw_mail_client_ips: $ext_1_ip
# --- TURN / STUN
fw_nc_turn_server_ips: $ext_1_ip
# --- Block
fw_blocked_ips_v4: 222.184.0.0/13 61.160.0.0/16 116.8.0.0/14