Merge branch 'CherryKitten-openhab'

* CherryKitten-openhab:
  whitespace
  Remove trailing whitespaces
  Added documentation for openHAB
  Add a missing line break
  Add openHAB to traefik.toml
  Add openHAB support
This commit is contained in:
David Stephens 2019-10-15 22:36:45 +01:00
commit 956a8d33ab
7 changed files with 86 additions and 0 deletions

View file

@ -54,6 +54,7 @@ Ansible config and a bunch of Docker containers.
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
* [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative
* [NZBget](https://nzbget.net/) - The most efficient usenet downloader
* [openHAB](https://www.openhab.org/) - A vendor and technology agnostic open source automation software for your home
* [Plex](https://www.plex.tv/) - Plex Media Server
* [Portainer](https://portainer.io/) - for managing Docker and running custom images
* [pyLoad](https://pyload.net/) - A download manager with a friendly web-interface

View file

@ -0,0 +1,15 @@
# openHAB
Homepage: [https://www.openhab.org/](https://www.openhab.org/)
OpenHab is a vendor and technology agnostic open source automation software for your home.
It allows you to connect many different IoT-Devices (which in this case means "Intranet of Things") using custom bindings made by the community.
## Usage
Set `openhab_enabled: true` in your `group_vars/all.yml` file.
## Specific Configuration
The openHAB Webinterface is available at port 7777 (HTTP) and 7778 (HTTPS).
Visit the webinterface and follow the setup instructions found in the [openHAB Documentation](https://www.openhab.org/docs/tutorial/1sttimesetup.html)

View file

@ -30,6 +30,8 @@ By default, applications can be found on the ports listed below.
| Netdata | 19999 | |
| Nextcloud | 8080 | |
| NZBGet | 6789 | |
| openHAB | 7777 | HTTP |
| openHAB | 7778 | HTTPS |
| Plex | 32400 | |
| Portainer | 9000 | |
| pyload | 8000 | |

View file

@ -83,6 +83,9 @@ mosquitto_enabled: false
# Calibre
calibre_enabled: false
# Smarthome
openhab_enabled: false
###
### General
###
@ -614,7 +617,15 @@ calibre_group_id: "0"
# To disable ebook conversion set calibre_ebook_conversion to "". To enable it set it to "linuxserver/calibre-web:calibre"
calibre_ebook_conversion: "linuxserver/calibre-web:calibre"
###
### Home Assistant
###
homeassistant_available_externally: "false"
homeassistant_data_directory: "{{ docker_home }}/homeassistant"
###
### openHAB
###
openhab_available_externally: "false"
openhab_docker_image: openhab/openhab:latest
openhab_data_directory: "{{ docker_home }}/openhab"

View file

@ -184,3 +184,8 @@
when: (bazarr_enabled | default(False))
tags: bazarr
- import_tasks: tasks/openhab.yml
when: (openhab_enabled | default(False))
tags: openhab

51
tasks/openhab.yml Normal file
View file

@ -0,0 +1,51 @@
---
- name: Create openHAB group
group:
name: openhab
gid: 9001
state: present
- name: Create openHAB user
user:
name: openhab
uid: 9001
state: present
system: yes
update_password: on_create
create_home: no
group: openhab
- name: Create openHAB Directories
file:
path: "{{ item }}"
state: directory
owner: openhab
group: openhab
with_items:
- "{{ openhab_data_directory }}"
- "{{ openhab_data_directory }}/conf"
- "{{ openhab_data_directory }}/userdata"
- "{{ openhab_data_directory }}/addons"
- name: Create openHAB container
docker_container:
name: openHAB
image: "{{ openhab_docker_image }}"
pull: true
network_mode: "host"
volumes:
- "{{ openhab_data_directory }}/conf:/openhab/conf:rw"
- "{{ openhab_data_directory }}/userdata:/openhab/userdata:rw"
- "{{ openhab_data_directory }}/addons:/openhab/addons:rw"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
env:
OPENHAB_HTTP_PORT: "7777"
OPENHAB_HTTPS_PORT: "7778"
restart_policy: unless-stopped
memory: 1g
labels:
traefik.backend: "openhab"
traefik.frontend.rule: "Host:openhab.{{ ansible_nas_domain }}"
traefik.enable: "{{ openhab_available_externally }}"
traefik.port: "80"

View file

@ -198,6 +198,7 @@ onDemand = false # create certificate when container is created
"netdata.{{ ansible_nas_domain }}",
"nextcloud.{{ ansible_nas_domain }}",
"nzbget.{{ ansible_nas_domain }}",
"openhab.{{ ansible_nas_domain }}",
"plex.{{ ansible_nas_domain }}",
"portainer.{{ ansible_nas_domain }}",
"pyload.{{ ansible_nas_domain }}",