move homebridge to role

This commit is contained in:
PurpleNinja225 2021-02-07 13:55:49 -09:00
parent 3645e1ac29
commit 8067631cb0
4 changed files with 28 additions and 19 deletions

View file

@ -62,7 +62,6 @@ wallabag_enabled: false
# Home Automation
mosquitto_enabled: false
homebridge_enabled: false
openhab_enabled: false
# Books
@ -291,16 +290,6 @@ pytivo_podcasts_directory: "{{ podcasts_root }}"
pytivo_user_id: "0"
pytivo_group_id: "0"
###
### Homebridge
###
homebridge_available_externally: "false"
homebridge_config_directory: "{{ docker_home }}/homebridge/config"
homebridge_user_id: "0"
homebridge_group_id: "0"
homebridge_port: "8087"
###
### Tautulli
###

View file

@ -98,6 +98,11 @@
- homeassistant
when: (homeassistant_enabled | default(False))
- role: homebridge
tags:
- homebridge
when: (homebridge_enabled | default(False))
- role: lidarr
tags:
- lidarr
@ -271,10 +276,6 @@
when: (mosquitto_enabled | default(False))
tags: mosquitto
- import_tasks: tasks/homebridge.yml
when: (homebridge_enabled | default(False))
tags: homebridge
- import_tasks: tasks/calibre.yml
when: (calibre_enabled | default(False))
tags: calibre

View file

@ -0,0 +1,18 @@
---
# enable or disable the application
homebridge_enabled: false
homebridge_available_externally: "false"
# directories
homebridge_config_directory: "{{ docker_home }}/homebridge/config"
# uid / gid
homebridge_user_id: "0"
homebridge_group_id: "0"
# network
homebridge_hostname: "homebridge"
homebridge_port: "8087"
# specs
homebridge_memory: "1g"

View file

@ -3,17 +3,18 @@
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ homebridge_config_directory }}"
- name: Homebridge Docker Container
- name: Create Homebridge Docker Container
docker_container:
name: homebridge
image: oznu/homebridge
pull: true
volumes:
- "{{ homebridge_config_directory }}:/homebridge"
network_mode: host
network_mode: "host"
env:
TZ: "{{ ansible_nas_timezone }}"
PGID: "{{ homebridge_group_id }}"
@ -21,10 +22,10 @@
HOMEBRIDGE_CONFIG_UI: "1"
HOMEBRIDGE_CONFIG_UI_PORT: "{{ homebridge_port }}"
restart_policy: unless-stopped
memory: 1g
memory: "{{ homebridge_memory }}"
labels:
traefik.enable: "{{ homebridge_available_externally }}"
traefik.http.routers.homebridge.rule: "Host(`homebridge.{{ ansible_nas_domain }}`)"
traefik.http.routers.homebridge.rule: "Host(`{{ homebridge_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.homebridge.tls.certresolver: "letsencrypt"
traefik.http.routers.homebridge.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.homebridge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"