Skip to content

Commit 2427e01

Browse files
author
Derek
committed
fix: add LTS codename fallback for OpenVPN3 repo on Ubuntu interim releases
1 parent b94cac4 commit 2427e01

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

ansible/roles/developer_core/tasks/openvpn.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@
3131
dest: /etc/apt/keyrings/openvpn.asc
3232
mode: '0644'
3333

34+
# Map unsupported Ubuntu releases to nearest supported LTS
35+
# OpenVPN 3 only publishes repos for LTS releases (jammy, noble)
36+
- name: Determine OpenVPN repo codename
37+
ansible.builtin.set_fact:
38+
openvpn_codename: >-
39+
{{ (ansible_facts['distribution_version'] is version('24.04', '>'))
40+
| ternary('noble', ansible_facts['distribution_release']) }}
41+
3442
- name: Add OpenVPN 3 repository
3543
ansible.builtin.apt_repository:
36-
repo: "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian {{ ansible_facts['distribution_release'] }} main"
44+
repo: "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian {{ openvpn_codename }} main"
3745
filename: openvpn3
3846
state: present
3947

@@ -46,7 +54,11 @@
4654
rescue:
4755
- name: Warn about OpenVPN 3 installation failure
4856
ansible.builtin.debug:
49-
msg: "⚠️ WARNING: OpenVPN 3 installation failed (repository may not support {{ ansible_facts['distribution_release'] }} yet). Install manually if needed for SSO web auth."
57+
msg: "WARNING: OpenVPN 3 installation failed (repository may not support {{ ansible_facts['distribution_release'] }} yet). Install manually if needed for SSO web auth."
58+
59+
- name: Set OpenVPN 3 install failed fact
60+
ansible.builtin.set_fact:
61+
openvpn3_install_failed: true
5062

5163
when: ansible_facts['distribution'] == 'Ubuntu'
5264

ansible/roles/developer_core/tasks/verify.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
register: verify_openvpn
8989
changed_when: false
9090
failed_when: verify_openvpn.rc != 0
91-
when: ansible_facts['distribution'] in ['Fedora', 'Ubuntu']
91+
when:
92+
- ansible_facts['distribution'] in ['Fedora', 'Ubuntu']
93+
- not (openvpn3_install_failed | default(false))
9294

9395
- name: Verify OpenVPN 3 (macOS)
9496
ansible.builtin.command: openvpn --version
@@ -223,7 +225,7 @@
223225
- Node.js: {{ verify_node.stdout | default('installed') }}
224226
- semantic-release: {{ verify_semrel.stdout | default('installed') }}
225227
- Linear CLI: {{ verify_linear.stdout | default('installed') }}
226-
- OpenVPN: {{ verify_openvpn.stdout | default('installed') }}
228+
- OpenVPN: {{ verify_openvpn.stdout | default('skipped (install failed - manual install required)') }}
227229
- NetBird CLI: {{ verify_netbird.stdout | default('installed') }}
228230
- Claude Code CLI: {{ verify_claude.stdout | default('installed') }}
229231
- Gitleaks: {{ verify_gitleaks.stdout | default('installed') }}

0 commit comments

Comments
 (0)