2018-11-07 22:05:47 +00:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Create tls folder structure
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
recurse: True
|
|
|
|
with_items:
|
|
|
|
- "{{ mosquitto_tls_cert_path | dirname }}"
|
|
|
|
- "{{ mosquitto_tls_key_path | dirname }}"
|
|
|
|
|
|
|
|
- name: Copy certs and private key (file)
|
|
|
|
copy:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
with_items:
|
|
|
|
- { src: "{{ mosquitto_tls_key_source }}", dest: '{{ mosquitto_tls_key_path }}', mode: '0600' }
|
|
|
|
- { src: "{{ mosquitto_tls_cert_source }}", dest: '{{ mosquitto_tls_cert_path }}', mode: '0750' }
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
when: mosquitto_tls_source_use_files
|
|
|
|
|
|
|
|
- name: Copy certs and private key (content)
|
|
|
|
copy:
|
|
|
|
content: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
with_items:
|
|
|
|
- { src: "{{ mosquitto_tls_key_source }}", dest: '{{ mosquitto_tls_key_path }}', mode: '0600' }
|
|
|
|
- { src: "{{ mosquitto_tls_cert_source }}", dest: '{{ mosquitto_tls_cert_path }}', mode: '0750' }
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
when: mosquitto_tls_source_use_content
|
|
|
|
become: True
|
2018-11-07 22:25:17 +00:00
|
|
|
become_user: root
|