Skip to content

Home Assistant Ansible Role


This role is designed to be a full life cycle management solution for a Home Assistant PC. All of the components within this role are deployed via docker as containers with interconnection via internal docker networks. Access to services from outside of localhost is via an ingress network, which by default is limited to services Grafana, Home Assistant and Mosquitto.

By design this role deploys it's services to be in a state to be ready to have backups restored to it.

Features

  • Alerting ToDo

    • ToDo deadman checks for services. i.e. if a service stops producing data, an alert will be fired

    • ToDo Linked to Home Assistant

  • ToDo Backups (automated including recovery option on error)

  • Metrics, Telegraf

    • Docker daemon

    • MQTT Messages

  • MQTT Broker, Mosquitto

  • Storage

    • Metrics, InfluxDB

    • ToDo Home Assistant, MySQL/MariaDB

  • ToDo Updating (fully automated)

    • ToDo Linked to Home Assistant
  • Visualization, Grafana

    • ToDo Dashboards Included:

      • ToDo Docker Stack

      • ToDo InfluxDB

      • ToDo MariaDB/MySQL

      • ToDo MQTT

      • ToDo Node Exporter

Using this role

This role is depenedent upon nfc_docker_management. To use this role, define variables to override any defaults to suit your needs and add nfc_homeassistant role to your playbook.

When running the role you can limit scope by using ansible tags. the available tags are:

  • grafana

  • influxdb

Info

When you limit the scope, everything required to deploy that scope is included, even if it's from a different scope. i.e. if tag grafana is used, when the data sources are deployed the InfluxDB tokens are fetched.

Role Default Variables

defaults/main.yaml
---

install_docker: true

# temp remove!!!!!!!!!!!!!!!!!!
versions:
  home_assistant: '2022.10.4'
  node_red: 3.0.2-18

grafana:

  container_name: grafana

  docker_image:
    name: grafana/grafana
    tag: '10.1.2'

  # Deploy Grafana
  # Type: bool
  enabled: true

  # network_name: grafana


home_assistant:

  docker_image:
    name: homeassistant/home-assistant
    tag: '2023.9.3'

  container_name: home_assistant

  # Deploy Home Assistant
  # Type: bool
  enabled: true

  network_name: home_assistant


influxdb:
  # URL used to connect to InfluxDB API. note: no trailing slants
  api_url: 'http://172.16.10.66:8086/api/v2'

  container_name: influxdb

  network_name: influxdb

  docker_image:
    name: influxdb
    tag: '2.7.1-alpine'

  # Deploy InfluxDB
  # Type: bool
  enabled: true

  organization: homeassistant


mariadb:

  docker_image:
    name: mariadb
    tag: '10.3'

  container_name: mariadb

  # Deploy MariaDB
  # Type: bool
  enabled: true

  network_name: mariadb


mosquitto:

  container_name: mosquitto

  docker_image:
    name: eclipse-mosquitto
    tag: '2.0.15'

  # Deploy mosquitto
  # Type: bool
  enabled: true


node_exporter:

  container_name: node_exporter

  docker_image:
    name: prom/node-exporter
    tag: 'v1.6.1'

  # Deploy mosquitto
  # Type: bool
  enabled: true


telegraf:

  # Name of the telegraf container. This name will be suffixed to the role.
  # i.e. {container_name}-docker, {container_name}-mqtt
  # Type: string
  container_name: telegraf

  docker_image:
    name: telegraf
    tag: '1.28.1-alpine'

  # Deploy telegraf
  # Type: bool
  enabled: true

About:

This page forms part of our Project Role Home Assistant.

Page Metadata
Version: ToDo: place files short git commit here
Date Created: 2023-10-07
Date Edited: 2023-10-28

Contribution:

Would You like to contribute to our Role Home Assistant project? You can assist in the following ways:

 

ToDo: Add the page list of contributors

Back to top