Files
vpn-node-config/.gitea/workflows/openvpn-pki-identity.yml
T
gitea_admin 36d2845a3a
OpenVPN Ansible / Ansible Lint (push) Successful in 1m7s
OpenVPN Ansible / Ansible Syntax Check (push) Successful in 48s
OpenVPN Ansible / Deploy VPN Networking and OpenVPN (push) Successful in 1m50s
OpenVPN Ansible / Generate SBOM (push) Successful in 55s
OpenVPN Ansible / Scan SBOM with Trivy (push) Successful in 21s
feat(openvpn-pki): add JWT identity preparation workflow
- Add dedicated Ansible playbook and role for VPN server JWT identities
- Generate and securely store per-server RSA key pairs
- Export public keys as workflow artifacts for manual OpenBao registration
- Add community.crypto collection dependency
2026-11-26 11:01:09 +01:00

72 lines
2.1 KiB
YAML

name: OpenVPN JWT Identity Preparation
on:
workflow_dispatch:
inputs:
vpn_host:
description: Inventory hostname of the VPN server to prepare
required: true
type: string
jobs:
prepare-identity:
name: Prepare VPN JWT identity
runs-on: hetzner-ubuntu-latest
container:
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
set -eu
mkdir -p ~/.ssh
printf '%s\n' "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keygen -y -f ~/.ssh/id_ed25519 > /dev/null
- name: Install Ansible collections
run: ansible-galaxy collection install -r requirements.yml
- name: Validate selected VPN host
env:
VPN_HOST: ${{ github.event.inputs.vpn_host }}
run: |
set -eu
ansible-inventory -i inventories/prod/hosts.ini --list | python3 -c '
import json
import os
import sys
inventory = json.load(sys.stdin)
selected_host = os.environ["VPN_HOST"]
vpn_hosts = inventory.get("vpn_nodes", {}).get("hosts", [])
if selected_host not in vpn_hosts:
print("vpn_host must exactly match a host in the vpn_nodes inventory group", file=sys.stderr)
sys.exit(1)
'
- name: Prepare JWT identity
env:
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible.cfg
VPN_HOST: ${{ github.event.inputs.vpn_host }}
run: |
set -eu
ansible-playbook \
-i inventories/prod/hosts.ini \
playbooks/openvpn-pki-identity.yml \
--limit "$VPN_HOST"
- name: Upload public JWT key
uses: actions/upload-artifact@v4
with:
name: openvpn-pki-public-keys
path: artifacts/openvpn-pki-public-keys/*.pem
if-no-files-found: error
retention-days: 7