2021-02-21 19:50:07 +00:00
|
|
|
---
|
2019-07-23 20:07:40 +00:00
|
|
|
- name: Create Home Assistant Directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ homeassistant_data_directory }}/config"
|
|
|
|
|
|
|
|
- name: Home Assistant Docker Container
|
|
|
|
docker_container:
|
|
|
|
name: homeassistant
|
|
|
|
image: homeassistant/home-assistant
|
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ homeassistant_data_directory }}/config:/config:rw"
|
2020-01-16 09:52:26 +00:00
|
|
|
network_mode: host
|
2019-07-23 20:07:40 +00:00
|
|
|
restart_policy: unless-stopped
|
2019-10-13 22:23:37 +00:00
|
|
|
env:
|
|
|
|
TZ: "{{ ansible_nas_timezone }}"
|
2019-07-23 20:07:40 +00:00
|
|
|
labels:
|
|
|
|
traefik.enable: "{{ homeassistant_available_externally }}"
|
2021-01-19 17:18:12 +00:00
|
|
|
traefik.http.routers.homeassistant.rule: "Host(`{{ homeassistant_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.homeassistant.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.homeassistant.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.homeassistant.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.services.homeassistant.loadbalancer.server.port: "8123"
|
2021-02-23 15:16:29 +00:00
|
|
|
memory: "{{ homeassistant_memory }}"
|