Skip to content

Commit 38a31f8

Browse files
committed
Allow changing service name
1 parent c6b8898 commit 38a31f8

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ openvpn_scripts_dir: "{{ openvpn_etcdir }}/scripts/"
218218
# In some distros, the server with `foobar.conf` config file can be managed
219219
# using `openvpn@foobar` service
220220
openvpn_config_file: "{{ openvpn_etcdir }}/server.conf"
221+
openvpn_service_name: '' # use the default os-dependent
221222

222223
openvpn_client_config_dir: "{{ openvpn_etcdir }}/ovpns"
223224

handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- ansible_lsb.codename != "trusty"
3434
listen: openvpn save iptables
3535

36-
- name: Restart OpenVPN service
36+
- name: Restart OpenVPN service ({{ openvpn_service }})
3737
service:
3838
name: "{{ openvpn_service }}"
3939
state: restarted

tasks/variables.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
- "Common-default.yml"
1414
paths:
1515
- 'vars/os'
16+
17+
- name: "Set openvpn_service"
18+
set_fact:
19+
openvpn_service: "{{ openvpn_service_name|default(openvpn_service) }}"

0 commit comments

Comments
 (0)