xoxys.homeassistant_docker/tasks/install.yml

58 lines
1.6 KiB
YAML

---
- name: Prepare base folders
file:
path: "{{ item }}"
state: directory
owner: "{{ homeassistant_user }}"
group: "{{ homeassistant_user }}"
mode: 0750
loop:
- "{{ homeassistant_base_dir }}"
- "{{ homeassistant_conf_dir }}"
become: True
become_user: root
- block:
- name: Upgrade python dependencies
pip:
name: "{{ item }}"
virtualenv: "{{ homeassistant_base_dir }}/venv"
virtualenv_command: /usr/bin/python3 -m venv
extra_args: --upgrade
loop:
- pip
- setuptools
- wheel
- name: Install homeassistant
pip:
name: homeassistant
version: "{{ homeassistant_version }}"
virtualenv: "{{ homeassistant_base_dir }}/venv"
virtualenv_command: /usr/bin/python3 -m venv
notify: __homeassistant_restart
become: True
become_user: "{{ homeassistant_user }}"
- block:
- name: Patch /boot/cmdline
copy:
content: "{{ homeassistant_cmdline_content }}"
dest: /boot/cmdline.txt
when: homeassistant_cmdline_override_enabled | bool
- name: Exclude serial devices from ModemManager
template:
src: "etc/udev/rules.d/99-mm-disable.rules.j2"
dest: "/etc/udev/rules.d/99-mm-disable.rules"
when: homeassistant_exclude_modemmanager | bool
notify: __udev_reload
- name: Copy systemd unit file
template:
src: "etc/systemd/system/homeassistant.service.j2"
dest: "/etc/systemd/system/homeassistant.service"
notify: __homeassistant_restart
become: True
become_user: root