Skip to content

Commit

Permalink
Allow changing service name
Browse files Browse the repository at this point in the history
  • Loading branch information
tahajahangir committed Nov 29, 2020
1 parent c6b8898 commit 38a31f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ openvpn_scripts_dir: "{{ openvpn_etcdir }}/scripts/"
# In some distros, the server with `foobar.conf` config file can be managed
# using `openvpn@foobar` service
openvpn_config_file: "{{ openvpn_etcdir }}/server.conf"
openvpn_service_name: '' # use the default os-dependent

openvpn_client_config_dir: "{{ openvpn_etcdir }}/ovpns"

Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- ansible_lsb.codename != "trusty"
listen: openvpn save iptables

- name: Restart OpenVPN service
- name: Restart OpenVPN service ({{ openvpn_service }})
service:
name: "{{ openvpn_service }}"
state: restarted
Expand Down
4 changes: 4 additions & 0 deletions tasks/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
- "Common-default.yml"
paths:
- 'vars/os'

- name: "Set openvpn_service"
set_fact:
openvpn_service: "{{ openvpn_service_name|default(openvpn_service) }}"

0 comments on commit 38a31f8

Please sign in to comment.