This commit is contained in:
parent
30492f7228
commit
bbf0246554
9
handlers/main.yml
Normal file
9
handlers/main.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Restart openvpn client
|
||||
service:
|
||||
name: "openvpn@{{ openvpn_client_name }}"
|
||||
state: restarted
|
||||
enabled: yes
|
||||
listen: __openvpn_restart
|
||||
become: True
|
||||
become_user: root
|
@ -16,7 +16,7 @@
|
||||
- name: Write client config
|
||||
template:
|
||||
src: etc/openvpn/client.conf.j2
|
||||
dest: "/etc/openvpn/{{ openvpn_name }}.conf"
|
||||
dest: "/etc/openvpn/{{ openvpn_client_name }}.conf"
|
||||
mode: 0600
|
||||
notify: __openvpn_restart
|
||||
|
||||
@ -33,6 +33,12 @@
|
||||
- { src: "{{ openvpn_client_ta_source | default(False) }}", dest: "/etc/openvpn/certs/{{ openvpn_client_ta_file }}", mode: "0600" }
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
notify: __nginx_reload
|
||||
notify: __openvpn_restart
|
||||
|
||||
- name: Ensure openvpn service is up and running
|
||||
systemd:
|
||||
name: "openvpn@{{ openvpn_client_name }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
become: True
|
||||
become_user: root
|
||||
|
Loading…
Reference in New Issue
Block a user