Files
ansible/home_assistant.yaml

82 lines
2.6 KiB
YAML

- name: Setup Home Assistant
hosts: podman1
become: true
become_user: root
tasks:
- name: Pull Home Assistant image
containers.podman.podman_image:
name: ghcr.io/home-assistant/home-assistant:stable
- name: Pull Matter Server image
containers.podman.podman_image:
name: ghcr.io/matter-js/python-matter-server:stable
- name: Pull openthread image
containers.podman.podman_image:
name: docker.io/openthread/border-router:latest
- name: Create network for iot interface
containers.podman.podman_network:
name: iot
macvlan: ens19
- name: Create network for infra interface
containers.podman.podman_network:
name: infra
macvlan: ens18
- name: Create config directories
ansible.builtin.file:
path: "{{item}}"
state: directory
loop:
- /var/homeassistant
- /var/matter_server
- /var/thread_router
- name: Create Home Assistant Container
containers.podman.podman_container:
name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
recreate: true
restart_policy: "unless-stopped"
hostname: homeassistant1
network:
- iot
- infra
privileged: true
state: started
volumes:
- "/var/homeassistant:/config"
- name: Create Matter Server Container
containers.podman.podman_container:
name: matter
image: ghcr.io/matter-js/python-matter-server:stable
hostname: matter1
recreate: true
restart_policy: "unless-stopped"
network:
- iot
- infra
privileged: true
state: started
volumes:
- "/var/matter_server:/data"
- name: Create OpenThread container
containers.podman.podman_container:
name: thread
image: docker.io/openthread/border-router:latest
hostname: openthread1
recreate: true
restart_policy: "unless-stopped"
network:
- iot
device: "/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_10B41DE60794-if00:/dev/ttyACM5"
privileged: true
state: started
volumes:
- "/var/thread_router:/data"
env:
OT_RCP_DEVICE: "spinel+hdlc+uart:///dev/ttyACM5?uart-baudrate=460800"
OT_INFRA_IF: "eno1"
OT_THREAD_IF: "wpan0"
OT_LOG_LEVEL: "1"
OT_REST_LISTEN_ADDR: "0.0.0.0"
OT_REST_LISTEN_PORT: "8981"
OT_WEB_LISTEN_ADDR: "0.0.0.0"
OT_WEB_LISTEN_PORT: "8980"