homeassistant: Prepare system for installation (install packages, create directories)
This commit is contained in:
parent
b629b62974
commit
3b8cc7d1ea
@ -1,3 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
# Python version required for home assistant
|
||||||
ha_python_version: '3.12'
|
ha_python_version: '3.12'
|
||||||
|
|
||||||
|
# The location of the config directory
|
||||||
|
ha_conf_dir: /etc/homeassistant
|
||||||
|
|
||||||
|
# The location of the installatin directory
|
||||||
|
ha_venv_dir: "/opt/homeassistant"
|
||||||
|
|
||||||
|
# The default user
|
||||||
|
ha_user: homeassistant
|
||||||
|
@ -3,3 +3,8 @@
|
|||||||
- name: Install python if required
|
- name: Install python if required
|
||||||
ansible.builtin.include_tasks: python_312.yml
|
ansible.builtin.include_tasks: python_312.yml
|
||||||
when: ha_python_version == '3.12'
|
when: ha_python_version == '3.12'
|
||||||
|
|
||||||
|
- name: Include sub-tasks
|
||||||
|
ansible.builtin.include_tasks: '{{ item }}'
|
||||||
|
loop:
|
||||||
|
- preparation.yml
|
||||||
|
41
roles/homeassistant/tasks/preparation.yml
Normal file
41
roles/homeassistant/tasks/preparation.yml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Install commonly-named packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
loop:
|
||||||
|
- python3
|
||||||
|
- python3-dev
|
||||||
|
- python3-venv
|
||||||
|
- python3-pip
|
||||||
|
- libffi-dev
|
||||||
|
- libssl-dev
|
||||||
|
- libjpeg-dev
|
||||||
|
- zlib1g-dev
|
||||||
|
- autoconf
|
||||||
|
- build-essential
|
||||||
|
- libopenjp2-7
|
||||||
|
- libtiff6
|
||||||
|
- libturbojpeg0
|
||||||
|
- tzdata
|
||||||
|
- git
|
||||||
|
- ffmpeg
|
||||||
|
|
||||||
|
- name: Create user
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ ha_user }}"
|
||||||
|
comment: "Home Assistant"
|
||||||
|
system: true
|
||||||
|
shell: "/sbin/nologin"
|
||||||
|
|
||||||
|
- name: Create directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: "02775"
|
||||||
|
owner: "{{ ha_user }}"
|
||||||
|
group: "{{ ha_user }}"
|
||||||
|
loop:
|
||||||
|
- "{{ ha_conf_dir }}"
|
||||||
|
- "{{ ha_venv_dir }}"
|
Loading…
Reference in New Issue
Block a user