refactor: use generic ansible modules service and package
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7b60463716
commit
efc4ede1dc
@ -32,17 +32,33 @@
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
loop:
|
||||
- { src: "{{ openvpn_client_ca_source | default('') }}", dest: "/etc/openvpn/certs/{{ openvpn_client_ca_file }}", mode: "0640" }
|
||||
- { src: "{{ openvpn_client_cert_source | default('') }}", dest: "/etc/openvpn/certs/{{ openvpn_client_cert_file }}", mode: "0640" }
|
||||
- { src: "{{ openvpn_client_key_source | default('') }}", 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" }
|
||||
- {
|
||||
src: "{{ openvpn_client_ca_source | default('') }}",
|
||||
dest: "/etc/openvpn/certs/{{ openvpn_client_ca_file }}",
|
||||
mode: "0640",
|
||||
}
|
||||
- {
|
||||
src: "{{ openvpn_client_cert_source | default('') }}",
|
||||
dest: "/etc/openvpn/certs/{{ openvpn_client_cert_file }}",
|
||||
mode: "0640",
|
||||
}
|
||||
- {
|
||||
src: "{{ openvpn_client_key_source | default('') }}",
|
||||
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:
|
||||
label: "{{ item.dest }}"
|
||||
when: item.src | length > 0
|
||||
notify: __openvpn_restart
|
||||
|
||||
- name: Ensure openvpn service is up and running
|
||||
systemd:
|
||||
service:
|
||||
name: "openvpn@{{ openvpn_client_name }}"
|
||||
state: "{{ openvpn_service_state }}"
|
||||
enabled: yes
|
||||
|
Loading…
Reference in New Issue
Block a user