[WIP] Perform installation of HomeAssistant host #71

Draft
noby wants to merge 13 commits from noby/ansible:homeassistant into master
3 changed files with 56 additions and 0 deletions
Showing only changes of commit 3b8cc7d1ea - Show all commits

View File

@ -1,3 +1,13 @@
---
# Python version required for home assistant
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

View File

@ -3,3 +3,8 @@
- name: Install python if required
ansible.builtin.include_tasks: python_312.yml
when: ha_python_version == '3.12'
- name: Include sub-tasks
ansible.builtin.include_tasks: '{{ item }}'
loop:
- preparation.yml

View 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 }}"