xoxys.mosquitto/tasks/tls.yml

27 lines
784 B
YAML
Raw Normal View History

2018-11-07 22:05:47 +00:00
---
- block:
2019-01-10 22:49:04 +00:00
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: root
group: root
recurse: True
2019-08-27 06:48:09 +00:00
loop:
2019-01-10 22:49:04 +00:00
- "{{ mosquitto_tls_cert_path | dirname }}"
- "{{ mosquitto_tls_key_path | dirname }}"
2018-11-07 22:05:47 +00:00
2019-02-04 18:13:45 +00:00
- name: Copy certs and private key
2019-01-10 22:49:04 +00:00
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
2019-08-27 06:48:09 +00:00
loop:
2019-01-10 22:49:04 +00:00
- { 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 }}"
2019-02-04 18:13:45 +00:00
notify: __mosquitto_restart
2018-11-07 22:05:47 +00:00
become: True
2018-11-07 22:25:17 +00:00
become_user: root