🎭 Ansible playbooks/role for the setup of Home Assistant.
Branch: master
Clone or download
Latest commit af81306 Aug 13, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
defaults Update license in files Aug 13, 2018
handlers Update license in files Aug 13, 2018
meta Update Fedora releases Aug 13, 2018
tasks Update license in files Aug 13, 2018
templates Look up the location of hass before writing the systemd file Mar 25, 2017
tests Update license in files Aug 13, 2018
vars Update license in files Aug 13, 2018
CLA.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license Jan 28, 2017
CODE_OF_CONDUCT.md Add organization docs Jan 23, 2017
LICENSE.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license Jan 28, 2017
README.md Fix link Aug 26, 2017


License: Apache

Home Assistant

This role deploys Home Assistant to a remote system.


One requirement is to have a system with a configured instance of Ansible. This means that you have an inventory and access to the remote system via SSH with keys.

  1. Add the remote system to your Ansible's hosts (/etc/ansible/hosts) file to the group [home-assistant].
  2. For every system you want to manage, you need to have the master's SSH key in the authorized_keys file of the managed/remote system.

From the management system for the user root:

$ sudo ssh-copy-id -i /home/[your local user]/.ssh/id_rsa.pub root@[IP address of remote system]

While checking if you are able to login the remote system without password, you should check if Python and the DNF Python binding are available. If not, install them to save some time later.

$ sudo dnf -y install python python-dnf
  1. Perform a first check if Ansible works. You need to use the user root:
$ ansible home-assistant -m ping -u root -b | success >> {
    "changed": false,
    "ping": "pong"

For further details about the setup of Ansible, check their documentation.

Role Variables

  • ha_venv: The location of the virtual environment. Defaults to /opt/home-assistant
  • ha_user: The user for Home Assistant. Defaults to ha.
  • ha_port: The default port which is 8123. If you change that, you will need to modify the configuration.yml file of Home Assistant.
  • pkgs: List of packages to install on the remote system.


There are no dependencies for this role.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: home-assistant
     - home-assistant.home-assistant-ansible


Think first before you implement stuff from this repository. Consider the playbooks in this repository as non-generic. They were made especially for the deployment of Home Assistant and Fedora at the moment.


Apache 2.0

Author Information

Fabian Affolter. If you are too young to know what e-mail is, use @fabaff ;-).