Added configuration for Fedora-HomeAssistant
This commit is contained in:
@@ -60,6 +60,12 @@ files:
|
|||||||
download_updates = yes
|
download_updates = yes
|
||||||
upgrade_type = security
|
upgrade_type = security
|
||||||
|
|
||||||
|
#FileForHass
|
||||||
|
- path: /opt/Setup
|
||||||
|
generator: copy
|
||||||
|
source: CT-Files/hass
|
||||||
|
variants:
|
||||||
|
- hass
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
manager: dnf
|
manager: dnf
|
||||||
@@ -86,6 +92,7 @@ packages:
|
|||||||
- policycoreutils
|
- policycoreutils
|
||||||
- procps-ng
|
- procps-ng
|
||||||
- systemd-udev
|
- systemd-udev
|
||||||
|
- systemd-networkd
|
||||||
- which
|
- which
|
||||||
- dnf-automatic
|
- dnf-automatic
|
||||||
action: install
|
action: install
|
||||||
@@ -96,6 +103,34 @@ packages:
|
|||||||
- sssd-client
|
- sssd-client
|
||||||
action: remove
|
action: remove
|
||||||
|
|
||||||
|
#PKGS for Hass
|
||||||
|
- packages:
|
||||||
|
- git
|
||||||
|
- python3
|
||||||
|
- python3-virtualenv
|
||||||
|
- python3-pip
|
||||||
|
- python3-devel
|
||||||
|
- libffi-devel
|
||||||
|
- openssl-devel
|
||||||
|
- nmap
|
||||||
|
- glibc
|
||||||
|
- glibc-devel
|
||||||
|
- gcc
|
||||||
|
- gcc-c++
|
||||||
|
- make
|
||||||
|
- patch
|
||||||
|
- binutils
|
||||||
|
- turbojpeg
|
||||||
|
#- mariadb
|
||||||
|
- mariadb-connector-c-devel
|
||||||
|
- libudev-devel
|
||||||
|
- ffmpeg
|
||||||
|
- unzip
|
||||||
|
#- nano
|
||||||
|
action: install
|
||||||
|
variants:
|
||||||
|
- hass
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- trigger: post-unpack
|
- trigger: post-unpack
|
||||||
action: |-
|
action: |-
|
||||||
@@ -109,6 +144,9 @@ actions:
|
|||||||
# Let dnf find the fastest mirror
|
# Let dnf find the fastest mirror
|
||||||
echo fastestmirror=True >> /etc/dnf/dnf.conf
|
echo fastestmirror=True >> /etc/dnf/dnf.conf
|
||||||
|
|
||||||
|
# skip weak dependencies
|
||||||
|
echo install_weak_deps=False >> /etc/dnf/dnf.conf
|
||||||
|
|
||||||
#ProxyCacheSetting
|
#ProxyCacheSetting
|
||||||
echo '#CacheServer not set' >> /etc/dnf/dnf.conf
|
echo '#CacheServer not set' >> /etc/dnf/dnf.conf
|
||||||
|
|
||||||
@@ -140,8 +178,6 @@ actions:
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
umount -l /etc/resolv.conf || true
|
umount -l /etc/resolv.conf || true
|
||||||
rm /etc/resolv.conf
|
rm /etc/resolv.conf
|
||||||
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
|
||||||
systemctl enable systemd-resolved
|
|
||||||
cp -R /etc/skel/.bash* /root/
|
cp -R /etc/skel/.bash* /root/
|
||||||
|
|
||||||
systemctl enable dnf-automatic.timer
|
systemctl enable dnf-automatic.timer
|
||||||
@@ -155,3 +191,12 @@ actions:
|
|||||||
for repo in $(ls /etc/yum.repos.d/*.bak); do
|
for repo in $(ls /etc/yum.repos.d/*.bak); do
|
||||||
mv "${repo}" ${repo%.*}
|
mv "${repo}" ${repo%.*}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#Run provided init script
|
||||||
|
- trigger: post-files
|
||||||
|
action: |-
|
||||||
|
#!/bin/sh
|
||||||
|
bash /opt/Setup/Scripts/Init.sh || exit 1
|
||||||
|
rm /opt/Setup/Scripts/Init.sh
|
||||||
|
variants:
|
||||||
|
- hass
|
||||||
13
CT-Files/hass/Configs/hass.service
Normal file
13
CT-Files/hass/Configs/hass.service
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Home Assistant
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=hass
|
||||||
|
WorkingDirectory=/opt/HomeAssistant/data
|
||||||
|
ExecStart=/opt/HomeAssistant/srv/bin/hass -c "/opt/HomeAssistant/data"
|
||||||
|
RestartForceExitStatus=100
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
25
CT-Files/hass/Scripts/Init.sh
Normal file
25
CT-Files/hass/Scripts/Init.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#Install HomeAssistant
|
||||||
|
mkdir -p /opt/HomeAssistant/srv
|
||||||
|
mkdir -p /opt/HomeAssistant/data/custom_components/hacs
|
||||||
|
touch /opt/HomeAssistant/data/home-assistant.log
|
||||||
|
adduser --system --shell /bin/sh --home /opt/HomeAssistant/data hass
|
||||||
|
chown -R hass:hass /opt/HomeAssistant
|
||||||
|
su hass -c 'python3 -m venv /opt/HomeAssistant/srv'
|
||||||
|
|
||||||
|
su hass -c '. /opt/HomeAssistant/srv/bin/activate; pip install --upgrade pip; pip3 install wheel isal zlib-ng mysqlclient; pip3 install homeassistant'
|
||||||
|
|
||||||
|
#Install Home Assistant Community Store
|
||||||
|
curl -L --retry 7 --retry-delay 5 https://github.com/hacs/integration/releases/latest/download/hacs.zip -o /tmp/hacs.zip
|
||||||
|
su hass -c 'unzip -q /tmp/hacs.zip -d /opt/HomeAssistant/data/custom_components/hacs'
|
||||||
|
|
||||||
|
#Update script
|
||||||
|
mv /opt/Setup/Scripts/UpdateHASS.sh /opt/UpdateHASS.sh
|
||||||
|
|
||||||
|
#CleanUp
|
||||||
|
rm -rf /opt/HomeAssistant/data/.cache/*
|
||||||
|
rm -rf /usr/lib/python3.13/__pycache__/*
|
||||||
|
|
||||||
|
#Setup HomeAssistant service
|
||||||
|
mv /opt/Setup/Configs/hass.service /etc/systemd/system/hass.service
|
||||||
|
systemctl enable hass
|
||||||
3
CT-Files/hass/Scripts/PTKAppUpdate.sh
Normal file
3
CT-Files/hass/Scripts/PTKAppUpdate.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Update script for updating apps with ProxmoxHelper/ProxMoxToolKit
|
||||||
|
bash /opt/UpdateHASS.sh
|
||||||
4
CT-Files/hass/Scripts/UpdateHASS.sh
Normal file
4
CT-Files/hass/Scripts/UpdateHASS.sh
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
systemctl stop hass
|
||||||
|
sudo -u hass sh -c '. /opt/HomeAssistant/srv/bin/activate && pip install --upgrade pip && pip3 install --upgrade homeassistant'
|
||||||
|
service start hass
|
||||||
Reference in New Issue
Block a user