This commit is contained in:
parent
1a0e26a998
commit
3bffb1b180
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Restart openvpn client
|
- name: Restart openvpn client
|
||||||
service:
|
service:
|
||||||
name: "openvpn@{{ openvpn_client_name }}"
|
name: "{{ __openvpn_service_prefix }}@{{ openvpn_client_name }}"
|
||||||
state: "{{ 'restarted' if openvpn_service_state == 'started' else 'stopped' }}"
|
state: "{{ 'restarted' if openvpn_service_state == 'started' else 'stopped' }}"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
listen: __openvpn_restart
|
listen: __openvpn_restart
|
||||||
|
@ -32,26 +32,18 @@
|
|||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
loop:
|
loop:
|
||||||
- {
|
- src: "{{ openvpn_client_ca_source | default('') }}"
|
||||||
src: "{{ openvpn_client_ca_source | default('') }}",
|
dest: "/etc/openvpn/certs/{{ openvpn_client_ca_file }}"
|
||||||
dest: "/etc/openvpn/certs/{{ openvpn_client_ca_file }}",
|
mode: "0640"
|
||||||
mode: "0640",
|
- src: "{{ openvpn_client_cert_source | default('') }}"
|
||||||
}
|
dest: "/etc/openvpn/certs/{{ openvpn_client_cert_file }}"
|
||||||
- {
|
mode: "0640"
|
||||||
src: "{{ openvpn_client_cert_source | default('') }}",
|
- src: "{{ openvpn_client_key_source | default('') }}"
|
||||||
dest: "/etc/openvpn/certs/{{ openvpn_client_cert_file }}",
|
dest: "/etc/openvpn/certs/{{ openvpn_client_key_file }}"
|
||||||
mode: "0640",
|
mode: "0600"
|
||||||
}
|
- src: "{{ openvpn_client_ta_source | default('') }}"
|
||||||
- {
|
dest: "/etc/openvpn/certs/{{ openvpn_client_ta_file }}"
|
||||||
src: "{{ openvpn_client_key_source | default('') }}",
|
mode: "0600"
|
||||||
dest: "/etc/openvpn/certs/{{ openvpn_client_key_file }}",
|
|
||||||
mode: "0600",
|
|
||||||
}
|
|
||||||
- {
|
|
||||||
src: "{{ openvpn_client_ta_source | default('') }}",
|
|
||||||
dest: "/etc/openvpn/certs/{{ openvpn_client_ta_file }}",
|
|
||||||
mode: "0600",
|
|
||||||
}
|
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.dest }}"
|
label: "{{ item.dest }}"
|
||||||
when: item.src | length > 0
|
when: item.src | length > 0
|
||||||
|
Loading…
Reference in New Issue
Block a user