diff --git a/defaults/main.yml b/defaults/main.yml index d073ad5..ecbc8ef 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" diff --git a/handlers/main.yml b/handlers/main.yml index 7eec5fe..26d2ba5 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -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 diff --git a/tasks/service.yml b/tasks/service.yml index a4507bb..1cec747 100644 --- a/tasks/service.yml +++ b/tasks/service.yml @@ -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