1
0
Fork 0
home-stack-ansible/roles/homeassistant/tasks/main.yml

61 lines
1.2 KiB
YAML

- name: Install packages
apt:
update_cache: yes
name:
- acl # for become unprivileged user
- python3
- python3-dev
- python3-venv
- python3-pip
- bluez
- libffi-dev
- libssl-dev
- libjpeg-dev
- zlib1g-dev
- autoconf
- build-essential
- libopenjp2-7
- libtiff5
- libturbojpeg0-dev
- tzdata
- ffmpeg
- liblapack3
- liblapack-dev
- libatlas-base-dev
- name: Add user "homeassistant"
user:
name: homeassistant
create_home: true
system: true
- name: Create homeassistant install directory
file:
path: /srv/homeassistant
owner: homeassistant
group: homeassistant
state: directory
- name: Install homeassistant
become_user: homeassistant
pip:
virtualenv: /srv/homeassistant/
virtualenv_command: /usr/bin/python3 -m venv
name:
- wheel
- homeassistant==2023.5.4
- name: Copy hass service file
copy:
src: hass.service
dest: /etc/systemd/system/hass.service
owner: root
group: root
mode: 0644
- name: Enable hass service
systemd:
name: hass
daemon_reload: yes
state: started
enabled: yes