initial commit

This commit is contained in:
Patrick Neff 2022-01-24 22:18:15 +01:00
commit bd1f506d8b
4 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=homeassistant
WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target

4
handlers/main.yml Normal file
View File

@ -0,0 +1,4 @@
- name: restart homeassistant
ansible.builtin.service:
name: homeassistant
state: restarted

1
meta/main.yml Normal file
View File

@ -0,0 +1 @@
dependencies: []

36
tasks/main.yml Normal file
View File

@ -0,0 +1,36 @@
- name: Install dependencies.
ansible.builtin.package:
name:
- python3
- python3-dev
- python3-venv
- python3-pip
- libffi-dev
- libssl-dev
- libjpeg-dev
- zlib1g-dev
- autoconf
- build-essential
- libopenjp2-7
- libtiff5
- libturbojpeg0
- tzdata
- name: Install home-assistant
ansible.builtin.pip:
name: homeassistant
virtualenv: /srv/homeassistant
- name: Create home-assistant systemd service.
ansible.builtin.copy:
src: homeassistant.service
dest: /etc/systemd/system/homeassistant.service
owner: root
group: root
mode: 0644
- name: Enable homeassistant service.
ansible.builtin.service:
name: homeassistant
state: started
enabled: yes