homeassistant
Ansible role that deploys a supervised home assistant installation on my homeassistant device.
README
Home Assistant Supervised Role
This Ansible role installs Home Assistant Supervised on Debian 12+ systems with all required dependencies, networking configuration, and proper validation.
Features
- â Complete networking setup (NetworkManager + systemd-resolved)
- â Docker CE installation via official methods
- â OS-Agent installation with version selection
- â Home Assistant Supervised installation with machine type configuration
- â Comprehensive validation and error checking
- â Service management and automatic startup
- â Support for multiple architectures (x86_64, arm64)
- â Cleanup of downloaded packages
- â Proper privilege escalation and security
Requirements
BIOS Configuration Requirements
Critical BIOS settings must be configured before installation:
Essential Virtualization Settings
- Enable VT-x (Intel) or AMD-V (AMD) - Required for container virtualization
- Enable VT-d (Intel) or AMD IOMMU (AMD) - Required for hardware passthrough
- Location: Usually under "Advanced" â "CPU Configuration" or "Virtualization"
Boot Mode Configuration
- Enable UEFI boot mode - Modern container systems require UEFI
- Disable Secure Boot - May prevent proper container startup
- 64-bit support must be enabled
- Location: "Boot" â "Boot Mode" or "UEFI Settings"
Power Management Settings
- Enable "Auto Power On" or set "AC Recovery" â "Power On"
- Disable PCIe ASPM (Active State Power Management)
- Location: "Power" â "AC Recovery" and "Advanced" â "PCIe Configuration"
Hardware Features
Enable all available CPU virtualization features:
- Intel VT-x, VT-d extensions
- AMD SVM, IOMMU extensions
- Hardware virtualization support
Quick BIOS Checklist:
âï¸ Virtualization Technology: ENABLED
âï¸ VT-d/AMD IOMMU: ENABLED
âï¸ UEFI Boot: ENABLED
âï¸ Secure Boot: DISABLED
âï¸ Auto Power On: ENABLED
âï¸ PCIe ASPM: DISABLED
â ï¸ Important: BIOS menu names vary by manufacturer (ASUS, MSI, HP, etc.). Look for similar terms if exact names don't match.
System Requirements
- Ansible >= 2.12
- Target system: Debian 12+ (bookworm) or Ubuntu 22.04+ (jammy)
- Root/sudo access on target system
- Internet connectivity for package downloads
- Minimum 4GB RAM recommended
- 32GB+ storage space
Role Variables
Installation Control
homeassistant_install_supervisor: true # Install Home Assistant Supervised
homeassistant_configure_network: true # Configure networking (NetworkManager)
homeassistant_install_docker: true # Install Docker CE
homeassistant_install_os_agent: true # Install Home Assistant OS-Agent
Home Assistant Configuration
homeassistant_machine_type: qemux86-64 # Machine type for HA installation
homeassistant_data_share: /usr/share/hassio # Data directory location
Supported Machine Types:
qemux86-64- Generic x86-64 (recommended for most systems)qemuarm-64- Generic ARM64generic-x86-64- Generic x86-64 alternative
OS-Agent Settings
homeassistant_os_agent_version: latest # Use 'latest' or specific version
homeassistant_os_agent_arch: amd64 # Auto-detected based on system
Docker Configuration
homeassistant_docker_install_method: convenience_script # Installation method
Installation Methods:
convenience_script- Use Docker's get.docker.com script (default)apt_repository- Use official Docker APT repository
Network Management
homeassistant_manage_networking: true # Enable network configuration
homeassistant_disable_ifupdown: true # Disable traditional networking
homeassistant_enable_systemd_resolved: true # Enable systemd-resolved
Validation & Cleanup
homeassistant_validate_installation: true # Run post-install validation
homeassistant_cleanup_downloads: true # Remove downloaded packages
homeassistant_service_start_timeout: 300 # Service startup timeout (seconds)
Dependencies
The role automatically installs these system packages:
network-manager- Network managementsystemd-resolved- DNS resolutioncurl- HTTP client for downloadslsb-release- Distribution informationudisks2- Disk managementapparmor- Security profilesjq- JSON processingwget- File downloadsca-certificates- SSL certificatesgnupg- Package signing
Example Playbooks
Basic Installation
---
- hosts: homeassistant_servers
become: true
roles:
- role: homeassistant
Custom Configuration
---
- hosts: homeassistant_servers
become: true
roles:
- role: homeassistant
vars:
homeassistant_machine_type: generic-x86-64
homeassistant_os_agent_version: "1.6.0"
homeassistant_docker_install_method: apt_repository
homeassistant_data_share: /opt/homeassistant
Minimal Installation (Skip networking changes)
---
- hosts: homeassistant_servers
become: true
roles:
- role: homeassistant
vars:
homeassistant_configure_network: false
homeassistant_manage_networking: false
Tags
Use tags to run specific parts of the installation:
# Install only prerequisites
ansible-playbook -t homeassistant,prerequisites site.yml
# Configure networking only
ansible-playbook -t homeassistant,network site.yml
# Install Docker only
ansible-playbook -t homeassistant,docker site.yml
# Install OS-Agent only
ansible-playbook -t homeassistant,os-agent site.yml
# Install Supervisor only
ansible-playbook -t homeassistant,supervisor site.yml
# Run validation only
ansible-playbook -t homeassistant,validation site.yml
Post-Installation
After successful installation:
- Access Home Assistant:
http://your-server-ip:8123 - Initial setup takes 10-20 minutes for container downloads
- Monitor progress:
journalctl -u hassio-supervisor -f - Check service status:
systemctl status hassio-supervisor
Useful Commands
# Check all Home Assistant related services
systemctl status hassio-supervisor docker NetworkManager os-agent
# View Home Assistant logs
journalctl -u hassio-supervisor -f
# Check OS-Agent D-Bus interface
busctl introspect io.hass.os /io/hass/os
# Verify Docker containers
docker ps
# Check Home Assistant CLI
ha help
Troubleshooting
Common Issues
Web interface not accessible:
- Wait 10-20 minutes for initial container downloads
- Check firewall:
ufw allow 8123/tcp - Verify service:
systemctl status hassio-supervisor
Networking issues after installation:
- Reboot the system to ensure all network changes take effect
- Check NetworkManager:
systemctl status NetworkManager - Verify DNS resolution:
systemd-resolve --status
OS-Agent D-Bus errors:
- Restart OS-Agent:
systemctl restart os-agent - Check D-Bus:
busctl list | grep hass
Docker permission issues:
- Add user to docker group:
usermod -aG docker $USER - Re-login or restart session
Log Locations
- Home Assistant Supervisor:
journalctl -u hassio-supervisor - OS-Agent:
journalctl -u os-agent - Docker:
journalctl -u docker - NetworkManager:
journalctl -u NetworkManager
Architecture Support
| Architecture | Machine Type | OS-Agent Binary | Supported |
|---|---|---|---|
| x86_64 (Intel/AMD) | qemux86-64 | amd64 | â |
| ARM64 (64-bit ARM) | qemuarm-64 | arm64 | â |
| ARM32 (32-bit ARM) | - | arm | â (Not recommended) |
Security Considerations
- Role requires root/sudo access for system modifications
- Downloads packages from official sources only
- Validates package integrity where possible
- Configures proper file permissions and ownership
- Uses systemd service isolation
- Enables AppArmor profiles when available
License
MIT
Contributing
- Test on clean Debian 12+ system
- Ensure all validation steps pass
- Update documentation for any new variables
- Test with both installation methods (convenience_script and apt_repository)
- Verify compatibility with different machine types