xoxys.matrix/tasks/tls.yml
2019-01-19 02:19:57 +01:00

31 lines
910 B
YAML

---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: "{{ matrix_user }}"
group: "{{ matrix_group }}"
recurse: True
with_items:
- "{{ matrix_tls_cert_path | dirname }}"
- "{{ matrix_tls_key_path | dirname }}"
become: True
become_user: root
- block:
- name: Copy certs and private key
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: "{{ matrix_tls_key_source }}", dest: '{{ matrix_tls_key_path }}', mode: '0600' }
- { src: "{{ matrix_tls_cert_source }}", dest: '{{ matrix_tls_cert_path }}', mode: '0750' }
loop_control:
label: "{{ item.dest }}"
register: __matrix_certs_file
when: matrix_tls_source_use_files
become: True
become_user: "{{ matrix_user }}"