sub-import tls_from_file/content to minimize skips
This commit is contained in:
parent
02fa767496
commit
6155049503
@ -13,34 +13,10 @@
|
||||
become: True
|
||||
become_user: root
|
||||
|
||||
- block:
|
||||
- name: Copy certs and private key (file)
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_items:
|
||||
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
|
||||
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
register: __unifi_certs_file
|
||||
when: unifi_tls_source_use_files
|
||||
|
||||
- name: Copy certs and private key (content)
|
||||
copy:
|
||||
content: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_items:
|
||||
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
|
||||
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
register: __unifi_certs_content
|
||||
when: unifi_tls_source_use_content
|
||||
become: True
|
||||
become_user: "{{ unifi_user }}"
|
||||
- import_tasks: tls_from_file.yml
|
||||
when: unifi_tls_source_use_files
|
||||
- import_tasks: tls_from_content.yml
|
||||
when: unifi_tls_source_use_content
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
|
14
tasks/tls_from_content.yml
Normal file
14
tasks/tls_from_content.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Copy certs and private key
|
||||
copy:
|
||||
content: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_items:
|
||||
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
|
||||
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
register: __unifi_certs_content
|
||||
become: True
|
||||
become_user: "{{ unifi_user }}"
|
14
tasks/tls_from_file.yml
Normal file
14
tasks/tls_from_file.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Copy certs and private key
|
||||
copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_items:
|
||||
- { src: "{{ unifi_tls_key_source }}", dest: '{{ unifi_tls_key_file }}', mode: '0600' }
|
||||
- { src: "{{ unifi_tls_cert_source }}", dest: '{{ unifi_tls_cert_file }}', mode: '0750' }
|
||||
loop_control:
|
||||
label: "{{ item.dest }}"
|
||||
register: __unifi_certs_file
|
||||
become: True
|
||||
become_user: "{{ unifi_user }}"
|
Loading…
Reference in New Issue
Block a user