Files
ansible/home_assistant.yaml

100 lines
3.1 KiB
YAML
Raw Normal View History

2026-02-19 08:20:00 -05:00
- 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
2026-02-19 15:12:16 -05:00
- 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:
2026-02-19 15:19:42 -05:00
name: docker.io/openthread/border-router:latest
2026-02-19 08:20:00 -05:00
- name: Create network for iot interface
containers.podman.podman_network:
name: iot
2026-02-19 17:16:15 -05:00
interface_name: br5
2026-02-19 18:46:58 -05:00
ipam_driver: "dhcp"
2026-02-19 18:45:22 -05:00
disable_dns: "true"
2026-02-23 22:54:29 -05:00
ipv6: true
2026-02-19 17:51:19 -05:00
opt:
mode: "unmanaged"
- name: Create network for infra interface
2026-02-19 09:58:08 -05:00
containers.podman.podman_network:
name: infra
2026-02-19 17:16:15 -05:00
interface_name: br2
2026-02-19 18:46:58 -05:00
ipam_driver: "dhcp"
2026-02-19 18:45:22 -05:00
disable_dns: "true"
2026-02-19 17:51:19 -05:00
opt:
mode: "unmanaged"
2026-02-23 21:36:20 -05:00
#- name: Create network for infra interface
# containers.podman.podman_network:
# name: access
# interface_name: br4
# ipam_driver: "dhcp"
# disable_dns: "true"
# opt:
# mode: "unmanaged"
2026-02-19 15:12:16 -05:00
- name: Create config directories
2026-02-19 08:20:00 -05:00
ansible.builtin.file:
2026-02-19 15:13:39 -05:00
path: "{{item}}"
2026-02-19 08:20:00 -05:00
state: directory
2026-02-19 15:12:16 -05:00
loop:
- /var/homeassistant
- /var/matter_server
- /var/thread_router
2026-02-19 08:20:00 -05:00
- 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"
2026-02-19 15:12:16 -05:00
hostname: homeassistant1
2026-02-19 09:58:08 -05:00
network:
2026-02-23 23:45:34 -05:00
- "infra:ip=10.2.5.1"
2026-02-19 17:16:15 -05:00
- iot
2026-02-19 08:20:00 -05:00
privileged: true
state: started
volumes:
- "/var/homeassistant:/config"
2026-02-19 15:12:16 -05:00
- 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"
2026-02-23 23:19:55 -05:00
network: host
2026-02-19 15:12:16 -05:00
privileged: true
state: started
volumes:
- "/var/matter_server:/data"
- name: Create OpenThread container
containers.podman.podman_container:
name: thread
2026-02-19 15:34:35 -05:00
image: docker.io/openthread/border-router:latest
2026-02-19 15:12:16 -05:00
hostname: openthread1
recreate: true
restart_policy: "unless-stopped"
2026-02-23 22:37:43 -05:00
network: host
2026-02-23 21:36:20 -05:00
cap_add:
- NET_ADMIN
2026-02-23 22:14:37 -05:00
- NET_RAW
2026-02-19 19:56:15 -05:00
device:
- "/dev/serial/by-id/usb-Nabu_Casa_ZBT-2_10B41DE60794-if00:/dev/ttyACM5"
- "/dev/net/tun"
2026-02-19 15:12:16 -05:00
state: started
volumes:
- "/var/thread_router:/data"
env:
OT_RCP_DEVICE: "spinel+hdlc+uart:///dev/ttyACM5?uart-baudrate=460800"
2026-02-23 22:37:43 -05:00
OT_INFRA_IF: "br5"
2026-02-19 15:12:16 -05:00
OT_THREAD_IF: "wpan0"
2026-02-19 19:31:22 -05:00
OT_LOG_LEVEL: "7"
2026-02-19 15:12:16 -05:00
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"