monolithprojects.homeassistant_compliance

Home Assistant 监控合规性

Galaxy 质量 角色版本 角色下载量 分子测试 许可证

此角色将使 Debian 11 操作系统与 Home Assistant 监控器兼容。它将修复来自 Home Assistant 监控器的所有与操作系统相关的“系统不支持”警告消息。

需求

  • 操作系统:Debian 11
    (除了 Home Assistant OS,Home Assistant 团队仅正式支持 Debian 11 (bullseye) 运行监控器。更多细节请查看 这里)

  • 使用 root 权限运行此角色(become: true

  • 此角色将不会安装 Docker-CE,因此在运行此 Ansible 角色之前需要先解决此问题。我推荐使用 Ansible 角色 geerlingguy.docker

测试环境

  • Debian 11

角色变量

以下是 defaults/main.yml 的副本

---
# 启用 Apparmor
ha_fix_apparmor: yes

# 安装并启用 DBUS
ha_fix_dbus: yes

# 如果 Docker 版本低于最小支持版本,则更新到最新版本
ha_fix_docker: yes
ha_fix_docker_minimal: 20.10.17

# 卸载 LXC
ha_fix_lxc: yes

# 安装 Home Assistant OS 代理
ha_fix_osagent: yes
ha_fix_osagent_cpu_architecture: x86_64
ha_fix_osagent_download_repository: "home-assistant/os-agent"
ha_fix_osagent_version: latest

# 安装并启用 systemd-journal-remote
ha_fix_systemd_journal: yes

# 启用 systemd-resolved
ha_fix_systemd_resolved: yes

# 将 CGroup 还原为版本 1
ha_fix_cgroup: yes

# 安装并启用网络管理器
ha_fix_network_manager: yes

# 修复网络管理器时使用以下网络配置文件
# /etc/network/interfaces
ha_fix_network_manager_interfaces: |
  # 此文件由 Ansible 管理

  source-directory /run/network/interfaces.d

  auto lo
  iface lo inet loopback

# /etc/NetworkManager/system-connections/default
ha_fix_network_manager_default: |
  # 此文件由 Ansible 管理

  [connection]
  id=Supervisor default
  uuid=1c8d78bf-e4e0-4735-8dca-eb31635dba30
  type=802-3-ethernet
  llmnr=2
  mdns=2

  [ipv4]
  method=auto

  [ipv6]
  addr-gen-mode=stable-privacy
  method=auto

# /etc/NetworkManager/NetworkManager.conf
ha_fix_network_manager_conf: |
  # 此文件由 Ansible 管理

  [main]
  dns=default
  plugins=keyfile
  autoconnect-retries-default=0
  rc-manager=file

  [keyfile]
  unmanaged-devices=type:bridge;type:tun;driver:veth

  [logging]
  backend=journal

示例剧本

此剧本将安装 Docker-CE 并修复 Home Assistant 系统警告。

---
- name: 修复 Home Assistant 警告
  hosts: homeassistant
  become: true
  roles:
    - role: geerlingguy.docker
    - role: monolithprojects.homeassistant_compliance

许可证

MIT

作者信息

由 Michal Muransky 于 2022 年创建

关于项目

This Ansible role configure Debian 11 Operating System to be complient with Home Assistant Supervisor.

安装
ansible-galaxy install monolithprojects.homeassistant_compliance
许可证
mit
下载
55.7k
拥有者
Full-time Cloud Engineer, part-time adventurer