xoxys.homeassistant_docker/tasks/tls.yml

38 lines
1.2 KiB
YAML
Raw Normal View History

2019-04-27 11:52:50 +00:00
---
- block:
- name: Create tls folder structure
file:
path: "{{ item }}"
state: directory
owner: "{{ homeassistant_user }}"
group: "{{ homeassistant_group }}"
recurse: True
loop:
- "{{ homeassistant_tls_dhparam_path | dirname }}"
- "{{ homeassistant_tls_cert_path | dirname }}"
- "{{ homeassistant_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 }}"
loop:
- { src: "{{ homeassistant_tls_key_source }}", dest: '{{ homeassistant_tls_key_path }}', mode: '0600' }
- { src: "{{ homeassistant_tls_cert_source }}", dest: '{{ homeassistant_tls_cert_path }}', mode: '0650' }
loop_control:
label: "{{ item.dest }}"
notify: __homeassistant_restart
- name: Create Diffie-Hellman Parameter
openssl_dhparam:
path: "{{ homeassistant_tls_dhparam_path }}"
size: "{{ homeassistant_tls_dhparam_size }}"
when: homeassistant_tls_dhparam_path is defined
notify: __homeassistant_restart
become: True
become_user: "{{ homeassistant_user }}"