Files
vpn-node-config/roles/openvpn_jwt/tasks/generator.yml
T
gitea_admin 4b8e7f3592
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
refactor(vpn): split JWT identity and OpenVPN certificate lifecycle
- 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
2026-11-27 17:58:46 +01:00

53 lines
1.4 KiB
YAML

---
- name: Create JWT identity directory
ansible.builtin.file:
path: "{{ openvpn_jwt_directory }}"
state: directory
owner: root
group: root
mode: "0700"
- name: Deploy JWT generator script
ansible.builtin.template:
src: generate-vault-jwt.py.j2
dest: "{{ openvpn_jwt_generator_script }}"
owner: root
group: root
mode: "0750"
- name: Check JWT generator script
ansible.builtin.stat:
path: "{{ openvpn_jwt_generator_script }}"
register: openvpn_jwt_generator_stat
- name: Require executable JWT generator
ansible.builtin.assert:
that:
- openvpn_jwt_generator_stat.stat.isreg | default(false)
- openvpn_jwt_generator_stat.stat.executable | default(false)
fail_msg: >-
JWT generator is missing or not executable:
{{ openvpn_jwt_generator_script }}
- name: Check JWT Python interpreter
ansible.builtin.stat:
path: "{{ openvpn_jwt_python }}"
register: openvpn_jwt_python_stat
- name: Require JWT Python interpreter
ansible.builtin.assert:
that:
- openvpn_jwt_python_stat.stat.exists
- openvpn_jwt_python_stat.stat.executable | default(false)
fail_msg: >-
JWT Python interpreter is missing or not executable:
{{ openvpn_jwt_python }}
- name: Validate JWT Python dependencies
ansible.builtin.command:
argv:
- "{{ openvpn_jwt_python }}"
- -c
- "import jwt; import cryptography; assert hasattr(jwt, 'encode')"
changed_when: false