2019-04-27 11:52:50 +00:00
|
|
|
---
|
|
|
|
- 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 }}"
|
2019-04-27 12:21:37 +00:00
|
|
|
virtualenv: "{{ homeassistant_base_dir }}/venv"
|
2019-04-27 11:52:50 +00:00
|
|
|
virtualenv_command: /usr/bin/python3 -m venv
|
|
|
|
extra_args: --upgrade
|
|
|
|
loop:
|
|
|
|
- pip
|
|
|
|
- setuptools
|
|
|
|
- wheel
|
|
|
|
|
2019-11-24 16:40:25 +00:00
|
|
|
- name: Install homeassistant
|
2019-04-27 11:52:50 +00:00
|
|
|
pip:
|
|
|
|
name: homeassistant
|
|
|
|
version: "{{ homeassistant_version }}"
|
2019-04-27 12:21:37 +00:00
|
|
|
virtualenv: "{{ homeassistant_base_dir }}/venv"
|
2019-04-27 11:52:50 +00:00
|
|
|
virtualenv_command: /usr/bin/python3 -m venv
|
|
|
|
notify: __homeassistant_restart
|
|
|
|
become: True
|
|
|
|
become_user: "{{ homeassistant_user }}"
|
|
|
|
|
|
|
|
- block:
|
2019-05-04 15:25:31 +00:00
|
|
|
- name: Patch /boot/cmdline
|
|
|
|
copy:
|
|
|
|
content: "{{ homeassistant_cmdline_content }}"
|
|
|
|
dest: /boot/cmdline.txt
|
2019-05-19 20:50:00 +00:00
|
|
|
when: homeassistant_cmdline_override_enabled | bool
|
2019-05-04 15:25:31 +00:00
|
|
|
|
2019-05-04 15:47:38 +00:00
|
|
|
- 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"
|
2019-05-19 20:50:00 +00:00
|
|
|
when: homeassistant_exclude_modemmanager | bool
|
2019-05-04 21:26:07 +00:00
|
|
|
notify: __udev_reload
|
2019-05-04 15:47:38 +00:00
|
|
|
|
2019-04-27 11:52:50 +00:00
|
|
|
- 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
|