refactor(vpn): split JWT identity and OpenVPN certificate lifecycle
OpenVPN Ansible / Ansible Syntax Check (push) Successful in 43s
OpenVPN Ansible / Ansible Lint (push) Successful in 1m8s
OpenVPN Ansible / Deploy VPN Networking and OpenVPN (push) Successful in 3m32s
OpenVPN Ansible / Generate SBOM (push) Successful in 55s
OpenVPN Ansible / Scan SBOM with Trivy (push) Successful in 18s

- Add a dedicated role and workflow to generate VPN JWT identities and export public keys
- Run identity preparation automatically for VPN nodes awaiting OpenBao registration
- Gate OpenVPN and PKI setup until each node is registered
- Split PKI setup into runtime, configuration, service, and initial certificate tasks
- Restore TAP and bridge attachment after OpenVPN restarts
- Remove bundled server certificate and private key
This commit is contained in:
2026-11-27 17:58:46 +01:00
parent 36d2845a3a
commit 4b8e7f3592
35 changed files with 1322 additions and 303 deletions
@@ -0,0 +1,22 @@
BAO_ADDR={{ openvpn_pki_bao_addr | quote }}
BAO_CACERT={{ openvpn_pki_bao_cacert | quote }}
OPENVPN_CA_CERT={{ (openvpn_pki_certificate_dir ~ '/ca.crt') | quote }}
OPENVPN_CA_FINGERPRINT={{ openvpn_pki_company_ca_fingerprint_value | quote }}
BAO_BINARY={{ openbao_cli_binary_path | default('/usr/bin/bao') | quote }}
JWT_PRIVATE_KEY={{ openvpn_jwt_private_key_path | quote }}
JWT_SCRIPT={{ openvpn_jwt_generator_script | quote }}
JWT_PYTHON={{ openvpn_jwt_python | quote }}
JWT_ROLE={{ openvpn_jwt_role | quote }}
JWT_AUTH_PATH={{ openvpn_jwt_auth_mount | quote }}
JWT_GENERATOR_ARGS_JSON={{ openvpn_jwt_generator_args | to_json | quote }}
PKI_SIGN_PATH={{ openvpn_pki_sign_endpoint | quote }}
CERT_TTL={{ openvpn_pki_certificate_ttl | quote }}
CERT_DIR={{ openvpn_pki_certificate_dir | quote }}
WORKING_DIR={{ openvpn_pki_working_directory | quote }}
CERT_NAME={{ openvpn_pki_certificate_common_name | quote }}
EXPECTED_ISSUER={{ openvpn_pki_expected_issuer | quote }}
REQUIRE_SERVER_AUTH_EKU={{ openvpn_pki_require_server_auth_eku | bool | ternary('true', 'false') | quote }}
CERT_ALT_NAMES_JSON={{ (openvpn_pki_certificate_dns_sans + [openvpn_pki_certificate_common_name]) | unique | to_json | quote }}
RSA_KEY_BITS={{ openvpn_pki_certificate_rsa_bits | int }}
RENEW_BEFORE_DAYS={{ openvpn_pki_renew_before_days | int }}
OPENVPN_SERVICE={{ openvpn_pki_service | quote }}