ソースを参照

Merge pull request #500 from mikeashley/vpn-fix

Fix systemd configuration of OpenVPN server
Allen Riddell 9年前
コミット
43ca10872f
2個のファイルの変更8行の追加5行の削除
  1. 1
    1
      roles/vpn/handlers/main.yml
  2. 7
    4
      roles/vpn/tasks/openvpn.yml

+ 1
- 1
roles/vpn/handlers/main.yml ファイルの表示

2
   service: name=dnsmasq state=restarted
2
   service: name=dnsmasq state=restarted
3
 
3
 
4
 - name: restart openvpn
4
 - name: restart openvpn
5
-  service: name=openvpn state=restarted
5
+  service: name=openvpn@server state=restarted

+ 7
- 4
roles/vpn/tasks/openvpn.yml ファイルの表示

141
   template: src=etc_openvpn_server.conf.j2 dest=/etc/openvpn/server.conf
141
   template: src=etc_openvpn_server.conf.j2 dest=/etc/openvpn/server.conf
142
   notify: restart openvpn
142
   notify: restart openvpn
143
 
143
 
144
+- name: Copy OpenVPN PAM configuration file into place
145
+  copy: src=etc_pam.d_openvpn dest=/etc/pam.d/openvpn
146
+  notify: restart openvpn
147
+
148
+- name: Enable OpenVPN server systemd service unit
149
+  service: name=openvpn@server enabled=yes
150
+
144
 # OpenVPN must restart first so the 10.8.0.0 interface is available
151
 # OpenVPN must restart first so the 10.8.0.0 interface is available
145
 # to dnsmasq
152
 # to dnsmasq
146
 - meta: flush_handlers
153
 - meta: flush_handlers
149
   copy: src=etc_dnsmasq.conf dest=/etc/dnsmasq.conf
156
   copy: src=etc_dnsmasq.conf dest=/etc/dnsmasq.conf
150
   notify: restart dnsmasq
157
   notify: restart dnsmasq
151
 
158
 
152
-- name: Copy OpenVPN PAM configuration file into place
153
-  copy: src=etc_pam.d_openvpn dest=/etc/pam.d/openvpn
154
-  notify: restart openvpn
155
-
156
 - name: Copy the ca.crt and ta.key files that clients will need in order to connect to the OpenVPN server
159
 - name: Copy the ca.crt and ta.key files that clients will need in order to connect to the OpenVPN server
157
   command: cp {{ openvpn_path }}/{{ item[1] }} {{ openvpn_path }}/{{ item[0] }}
160
   command: cp {{ openvpn_path }}/{{ item[1] }} {{ openvpn_path }}/{{ item[0] }}
158
   tags:
161
   tags:

読み込み中…
キャンセル
保存