31 lines
828 B
YAML
31 lines
828 B
YAML
- name: Create home-assistant config directory
|
|
file:
|
|
path: /opt/homeassistant/config
|
|
state: directory
|
|
|
|
- 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
|
|
|
|
- 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
|