-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated homeassistant template to fix netdiscover requirement
- Loading branch information
Showing
5 changed files
with
88 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Integration with Automation and Orchestration tools | ||
|
||
## Introduction | ||
|
||
The purpose of this topic is to explore how the hooks and customization features offered could be used to provide tight integration with automation and orchestration tools. | ||
|
||
There are 3 ways in which automation and orchestration tools can hook into the containers created with this platform: | ||
- Through post-deployment configuration, using tools such as ansible, chef, puppet. | ||
- Through a call-back mechanism | ||
- Through the on-demand instantiation of containers | ||
|
||
# Ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,12 @@ all: info/init_ok bootstrap global finalize | |
|
||
bootstrap: | ||
dab bootstrap | ||
dab install python3-pip python3-dev python3-setuptools | ||
# These are known packaged dependancies | ||
dab install netdiscover python3-aiohttp | ||
dab install python3-appdirs python3-chardet python3-dev python3-distro-info python3-fuzzywuzzy | ||
dab install python3-jinja2 python3-mutagen python3-netifaces python3-pip python3-six python3-sqlalchemy | ||
dab install python3-markupsafe python3-pyparsing python3-requests python3-setuptools | ||
dab install python3-tz python3-voluptuous python3-xmltodict python3-yaml python3-zeroconf | ||
pip3 install -d . homeassistant | ||
install -m 0644 [email protected] ${BASEDIR}/etc/systemd/system/[email protected] | ||
install -m 0600 aiohttp-1.3.1.tar.gz ${BASEDIR}/tmp | ||
|
@@ -33,6 +38,7 @@ bootstrap: | |
dab exec rm -f /tmp/*.whl | ||
dab exec rm -f /tmp/*.tar.gz | ||
install -m 0700 runonce.sh ${BASEDIR}/etc/init.d/firstboot | ||
dab exec update-rc.d firstboot defaults | ||
install -m 0700 custom.sh ${BASEDIR}/tmp | ||
dab exec /bin/bash /tmp/custom.sh | ||
dab exec rm -f /tmp/custom.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
# Homeassistant | ||
# Home Assistant | ||
|
||
- Creates a Ubuntu Xenial template with Python 3 and Home Assistant home automation system | ||
- NOTE: Currently, this image will require some internet ac | ||
- Adds any customizations such as root login enabled or SSH keys from ../Makefile.global | ||
- Total uncompressed image size is *700 MB* | ||
- Total compressed image size is *257 MB* | ||
- Total uncompressed image size is *709 MB* | ||
- Total compressed image size is *259 MB* | ||
|
||
## How to use | ||
|
||
- Deploy the Home Assistant template as a Linux Container and wait for it to boot | ||
- Point your web browser to http://[container ip]:8123/ to view the Web Interface | ||
|
||
## Development Notes | ||
|
||
- Home Assistant will try to install all unmet dependancies at startup | ||
- This is an issue for isolated hosts as well as for Python modules which require compilation | ||
- Every new release will need some work to identify dependancy versions that have changed and new dependancies are added to the template | ||
- We first try to meet the dependancies with inbuilt Ubuntu packages, followed by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
#!/bin/bash | ||
### BEGIN INIT INFO | ||
# Provides: firstboot | ||
# Required-Start: $local_fs | ||
# Required-Stop: | ||
# Should-Start: $network $portmap nfs-common udev-mtab | ||
# Default-Start: S | ||
# Default-Stop: | ||
# Short-Description: First-boot system customization routines | ||
# Description: Provides first-boot system customization for | ||
# proxmox container templates. | ||
# Removes itself entirely when done. | ||
### END INIT INFO | ||
|
||
# Once the script has completed execution, delete ourselves | ||
rm $0 | ||
case "$1" in | ||
start) | ||
|
||
# Put first boot routines here | ||
|
||
# Create HASS user | ||
useradd -m hass | ||
|
||
# Upgrade pip | ||
pip3 install --upgrade pip | ||
|
||
# Install netdiscover | ||
pip3 install netdisco | ||
|
||
# Enable the Home Assistant service | ||
/bin/systemctl enable home-assistant@hass | ||
|
||
# Start the Home Assistant service (need to spawn or it will hold up this script) | ||
/bin/systemctl start home-assistant@hass & | ||
|
||
# Once the script has completed execution, delete ourselves | ||
update-rc.d firstboot disable | ||
rm $0 | ||
;; | ||
stop) | ||
echo "Not Implemented" | ||
;; | ||
status) | ||
echo "Not Implemented" | ||
;; | ||
restart|force-reload) | ||
echo "Not Implemented" | ||
;; | ||
*) | ||
echo "Usage: /etc/init.d/$NAME {start}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |