Skip to content

Commit 29c2169

Browse files
committed
refactor(obs): convert stunnel and openvpn configs to templates
Convert static stunnel.conf and openvpn-obs.conf files to templates to enable dynamic configuration via ansible variables. Also, add task to include ohpc-lenovo-common.yml. Assisted-by: Gemini 2.5 Flash Signed-off-by: Adrian Reber <[email protected]>
1 parent 78ccb2a commit 29c2169

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

ansible/roles/obs/ohpc-lenovo-c3.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
obs_worker_jobs: 6
1010
container_tag: amd64
1111
obs_repository_server: 10.255.254.0
12+
stunnel_remote_port: 8444
13+
openvpn_ifconfig: "10.255.254.1 10.255.254.0"
1214

1315
handlers:
1416
- name: Include handlers
@@ -21,6 +23,9 @@
2123
- name: Include automatic-updates.yml
2224
ansible.builtin.include_tasks: ../common/automatic-updates.yml
2325

26+
- name: Import ohpc-lenovo-common.yml
27+
ansible.builtin.import_tasks: ../test/ohpc-lenovo-common.yml
28+
2429
- name: Create OBS directories
2530
ansible.builtin.file:
2631
dest: "{{ item }}"
@@ -65,15 +70,15 @@
6570
- git
6671

6772
- name: Install stunnel configuration
68-
ansible.builtin.copy:
73+
ansible.builtin.template:
6974
src: stunnel.conf
7075
dest: /etc/stunnel/stunnel.conf
7176
owner: root
7277
group: root
7378
mode: "0600"
7479

7580
- name: Install openvpn configuration
76-
ansible.builtin.copy:
81+
ansible.builtin.template:
7782
src: openvpn-obs.conf
7883
dest: /etc/openvpn/client/obs.conf
7984
owner: root

ansible/roles/obs/ohpc-lenovo-repo.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
obs_worker_jobs: 6
1010
container_tag: amd64
1111
obs_repository_server: 10.255.255.0
12+
stunnel_remote_port: 8443
13+
openvpn_ifconfig: "10.255.255.1 10.255.255.0"
1214

1315
handlers:
1416
- name: Include handlers
@@ -50,15 +52,15 @@
5052
- git
5153

5254
- name: Install stunnel configuration
53-
ansible.builtin.copy:
55+
ansible.builtin.template:
5456
src: stunnel.conf
5557
dest: /etc/stunnel/stunnel.conf
5658
owner: root
5759
group: root
5860
mode: "0600"
5961

6062
- name: Install openvpn configuration
61-
ansible.builtin.copy:
63+
ansible.builtin.template:
6264
src: openvpn-obs.conf
6365
dest: /etc/openvpn/client/obs.conf
6466
owner: root

ansible/roles/obs/files/openvpn-obs.conf renamed to ansible/roles/obs/templates/openvpn-obs.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dev tun1
22
remote localhost
3-
ifconfig 10.255.255.1 10.255.255.0
3+
ifconfig {{ openvpn_ifconfig }}
44
secret /etc/openvpn/client/obs.key
55
cipher AES-256-CBC
66
keepalive 10 60
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[openvpn]
22
client = yes
33
accept = 30000
4-
connect = obs.openhpc.community:8443
4+
connect = obs.openhpc.community:{{ stunnel_remote_port }}
55
cert = /etc/stunnel/stunnel.pem

0 commit comments

Comments
 (0)