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 f55a4a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
- ansible_lsb.codename != "trusty"
listen: openvpn save iptables

- name: Restart OpenVPN service
- name: Restart OpenVPN service ({{ openvpn_service_name or penvpn_service }})
service:
name: "{{ openvpn_service }}"
name: "{{ openvpn_service_name or penvpn_service }}"
state: restarted
listen: openvpn restart
4 changes: 2 additions & 2 deletions tasks/service.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Ensure OpenVPN is started
- name: Ensure OpenVPN is started ({{ openvpn_service_name or penvpn_service }})
service:
name: "{{ openvpn_service }}"
name: "{{ openvpn_service_name or penvpn_service }}"
state: started
enabled: true

0 comments on commit f55a4a2

Please sign in to comment.