cleanup syntax
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Robert Kaussow 2021-10-19 22:07:35 +02:00
parent 1a0e26a998
commit 3bffb1b180
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 13 additions and 21 deletions

View File

@ -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

View File

@ -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