2024-01-16 22:42:39 +00:00
|
|
|
- name: Create home-assistant config directory
|
|
|
|
file:
|
|
|
|
path: /opt/homeassistant/config
|
|
|
|
state: directory
|
|
|
|
|
2024-01-20 05:22:56 +00:00
|
|
|
- name: Create home-assistant extra config directories
|
|
|
|
file:
|
|
|
|
path: '{{ item }}'
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- /opt/homeassistant/config/binary_sensors
|
|
|
|
- /opt/homeassistant/config/mqtt
|
|
|
|
- /opt/homeassistant/config/automations
|
|
|
|
|
2024-01-16 22:42:39 +00:00
|
|
|
- name: Copy home-assistant config
|
|
|
|
copy:
|
|
|
|
src: configuration.yaml
|
|
|
|
dest: /opt/homeassistant/config/configuration.yaml
|
|
|
|
|
|
|
|
- name: Start home-assistant
|
|
|
|
docker_container:
|
|
|
|
name: home-assistant
|
|
|
|
image: ghcr.io/home-assistant/home-assistant:{{ homeassistant.version }}
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
privileged: true
|
|
|
|
network_mode: host
|
|
|
|
volumes:
|
|
|
|
- /opt/homeassistant/config:/config
|
|
|
|
# - /run/dbus:/run/dbus:ro
|