diff --git a/index.md b/index.md index 41dd544..cfd1c4e 100644 --- a/index.md +++ b/index.md @@ -1,55 +1,57 @@ --- -title: homeassistant +title: homeassistant_docker type: docs --- -[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.homeassistant) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.homeassistant?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.homeassistant) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/ansible/xoxys.homeassistant/src/branch/master/LICENSE) +[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.homeassistant_docker) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.homeassistant_docker?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.homeassistant_docker) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/ansible/xoxys.homeassistant_docker/src/branch/master/LICENSE) Setup [Home Assistant](https://www.home-assistant.io/) server. Open source home automation that puts local control and privacy first. * [Default Variables](#default-variables) - * [homeassistant_base_dir](#homeassistant_base_dir) - * [homeassistant_client_url](#homeassistant_client_url) + * [homeassistant_cap_add](#homeassistant_cap_add) + * [homeassistant_cap_drop](#homeassistant_cap_drop) * [homeassistant_cmdline_content](#homeassistant_cmdline_content) * [homeassistant_cmdline_override_enabled](#homeassistant_cmdline_override_enabled) - * [homeassistant_conf_dir](#homeassistant_conf_dir) + * [homeassistant_container_name](#homeassistant_container_name) + * [homeassistant_cpu_shares](#homeassistant_cpu_shares) + * [homeassistant_devices](#homeassistant_devices) * [homeassistant_exclude_modemmanager](#homeassistant_exclude_modemmanager) - * [homeassistant_extra_groups](#homeassistant_extra_groups) - * [homeassistant_group](#homeassistant_group) - * [homeassistant_http_bind_port](#homeassistant_http_bind_port) - * [homeassistant_packages](#homeassistant_packages) + * [homeassistant_exposed_ports](#homeassistant_exposed_ports) + * [homeassistant_extra_hosts](#homeassistant_extra_hosts) + * [homeassistant_image](#homeassistant_image) + * [homeassistant_memory_limit](#homeassistant_memory_limit) + * [homeassistant_memory_reservation](#homeassistant_memory_reservation) + * [homeassistant_networks](#homeassistant_networks) + * [homeassistant_networks_applied](#homeassistant_networks_applied) + * [homeassistant_pids_limit](#homeassistant_pids_limit) + * [homeassistant_restart_policy](#homeassistant_restart_policy) + * [homeassistant_security_opt](#homeassistant_security_opt) * [homeassistant_serial_device](#homeassistant_serial_device) - * [homeassistant_systemd_after](#homeassistant_systemd_after) - * [homeassistant_tls_cert_path](#homeassistant_tls_cert_path) - * [homeassistant_tls_cert_source](#homeassistant_tls_cert_source) - * [homeassistant_tls_dhparam_path](#homeassistant_tls_dhparam_path) - * [homeassistant_tls_dhparam_size](#homeassistant_tls_dhparam_size) - * [homeassistant_tls_enabled](#homeassistant_tls_enabled) - * [homeassistant_tls_key_path](#homeassistant_tls_key_path) - * [homeassistant_tls_key_source](#homeassistant_tls_key_source) - * [homeassistant_user](#homeassistant_user) - * [homeassistant_user_home](#homeassistant_user_home) + * [homeassistant_service_directory](#homeassistant_service_directory) + * [homeassistant_service_stopped](#homeassistant_service_stopped) + * [homeassistant_timezone](#homeassistant_timezone) * [homeassistant_version](#homeassistant_version) + * [homeassistant_volumes](#homeassistant_volumes) * [Dependencies](#dependencies) --- ## Default Variables -### homeassistant_base_dir +### homeassistant_cap_add #### Default value ```YAML -homeassistant_base_dir: /opt/homeassistant +homeassistant_cap_add: [] ``` -### homeassistant_client_url +### homeassistant_cap_drop #### Default value ```YAML -homeassistant_client_url: https://hassio.example.com +homeassistant_cap_drop: [] ``` ### homeassistant_cmdline_content @@ -71,12 +73,39 @@ Override `/boot/cmdline.txt` with given conten. This can be necessary if you use homeassistant_cmdline_override_enabled: false ``` -### homeassistant_conf_dir +### homeassistant_container_name #### Default value ```YAML -homeassistant_conf_dir: '{{ homeassistant_base_dir }}/config' +homeassistant_container_name: homeassistant +``` + +### homeassistant_cpu_shares + +#### Default value + +```YAML +homeassistant_cpu_shares: _unset_ +``` + +#### Example usage + +```YAML +homeassistant_cpu_shares: '1024' +``` + +### homeassistant_devices + +Define required devices e.g. `/dev/ttyACM0`. + +#### Example usage + +```YAML +homeassistant_devices: + - src: "{{ homeassistant_serial_port }}" + dest: "{{ homeassistant_serial_port }}" + opt: z ``` ### homeassistant_exclude_modemmanager @@ -89,38 +118,108 @@ Prevent ModemManger from binding to serial devices and therefor blocking control homeassistant_exclude_modemmanager: false ``` -### homeassistant_extra_groups +### homeassistant_exposed_ports #### Default value ```YAML -homeassistant_extra_groups: - - tty - - dialout +homeassistant_exposed_ports: [] ``` -### homeassistant_group +### homeassistant_extra_hosts #### Default value ```YAML -homeassistant_group: '{{ homeassistant_user }}' +homeassistant_extra_hosts: [] ``` -### homeassistant_http_bind_port +### homeassistant_image #### Default value ```YAML -homeassistant_http_bind_port: 8123 +homeassistant_image: homeassistant/home-assistant:{{ homeassistant_version }} ``` -### homeassistant_packages +### homeassistant_memory_limit #### Default value ```YAML -homeassistant_packages: [] +homeassistant_memory_limit: _unset_ +``` + +#### Example usage + +```YAML +homeassistant_memory_limit: 512m +``` + +### homeassistant_memory_reservation + +#### Default value + +```YAML +homeassistant_memory_reservation: _unset_ +``` + +#### Example usage + +```YAML +homeassistant_memory_reservation: 256m +``` + +### homeassistant_networks + +#### Default value + +```YAML +homeassistant_networks: + - name: default +``` + +#### Example usage + +```YAML +homeassistant_networks: + - name: default + # optional network driver, defaults to 'bride' + driver: host + external: false +``` + +### homeassistant_networks_applied + +#### Default value + +```YAML +homeassistant_networks_applied: + - default +``` + +### homeassistant_pids_limit + +#### Default value + +```YAML +homeassistant_pids_limit: _unset_ +``` + +### homeassistant_restart_policy + +#### Default value + +```YAML +homeassistant_restart_policy: always +``` + +### homeassistant_security_opt + +#### Default value + +```YAML +homeassistant_security_opt: [] ``` ### homeassistant_serial_device @@ -133,85 +232,28 @@ homeassistant_serial_device: product_id: xxxx ``` -### homeassistant_systemd_after +### homeassistant_service_directory #### Default value ```YAML -homeassistant_systemd_after: - - network-online.target +homeassistant_service_directory: /var/lib/docker/services/homeassistant ``` -### homeassistant_tls_cert_path +### homeassistant_service_stopped #### Default value ```YAML -homeassistant_tls_cert_path: '{{ homeassistant_base_dir }}/tls/certs/mycert.pem' +homeassistant_service_stopped: false ``` -### homeassistant_tls_cert_source +### homeassistant_timezone #### Default value ```YAML -homeassistant_tls_cert_source: mycert.pem -``` - -### homeassistant_tls_dhparam_path - -#### Default value - -```YAML -homeassistant_tls_dhparam_path: '{{ homeassistant_base_dir }}/tls/dhparam.pem' -``` - -### homeassistant_tls_dhparam_size - -#### Default value - -```YAML -homeassistant_tls_dhparam_size: 2048 -``` - -### homeassistant_tls_enabled - -#### Default value - -```YAML -homeassistant_tls_enabled: false -``` - -### homeassistant_tls_key_path - -#### Default value - -```YAML -homeassistant_tls_key_path: '{{ homeassistant_base_dir }}/tls/private/mykey.pem' -``` - -### homeassistant_tls_key_source - -#### Default value - -```YAML -homeassistant_tls_key_source: mykey.pem -``` - -### homeassistant_user - -#### Default value - -```YAML -homeassistant_user: homeassistant -``` - -### homeassistant_user_home - -#### Default value - -```YAML -homeassistant_user_home: /home/{{ homeassistant_user }} +homeassistant_timezone: Europe/Berlin ``` ### homeassistant_version @@ -219,7 +261,36 @@ homeassistant_user_home: /home/{{ homeassistant_user }} #### Default value ```YAML -homeassistant_version: 0.92.1 +homeassistant_version: latest +``` + +### homeassistant_volumes + +Define required docker volumes. + +#### Default value + +```YAML +homeassistant_volumes: + - name: /opt/homeassistant/config + dest: /config + bind: true +``` + +#### Example usage + +```YAML +homeassistant_volumes: + # Instead of the name you could specify a path on the container host system, + # but you also have to enable bind mount for this volume + - name: data + # target location inside the container + dest: /var/www/app/data + # enable bind mount, if false volume will be configured as named volume + # keep in mind you MUST set bind in any case + bind: True + # Options for bind mounts + bind_opt: "ro,z" ``` ## Dependencies