From e7ffb1b56cdd9106386cc126d233545e6ef55b32 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Tue, 8 Dec 2020 23:15:56 -0500 Subject: [PATCH] Add compose app config for unif controller --- resources/docker-compose/unifi.yaml.j2 | 68 ++++++++++++++++++++++++++ vars/applications.yml | 18 +++++++ 2 files changed, 86 insertions(+) create mode 100644 resources/docker-compose/unifi.yaml.j2 diff --git a/resources/docker-compose/unifi.yaml.j2 b/resources/docker-compose/unifi.yaml.j2 new file mode 100644 index 0000000..f801f80 --- /dev/null +++ b/resources/docker-compose/unifi.yaml.j2 @@ -0,0 +1,68 @@ +--- +version: "3.7" + + +networks: + unifi: + name: unifi + driver: overlay + ipam: + driver: default + config: + - subnet: {{ omni_compose_apps.unifi.networks.main }} + + +volumes: + unifi-data: + name: datastore{{ omni_compose_apps.unifi.datastore }} + driver: glusterfs + + +services: + wlc: + image: jacobalberty/unifi:{{ omni_compose_apps.unifi.versions.default }} + hostname: en1-unifi-wlc + init: true + networks: + - unifi + ports: + - published: {{ omni_compose_apps.unifi.published.ports.8080 }} + target: 8080 + protocol: tcp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.8443 }} + target: 8443 + protocol: tcp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.8843 }} + target: 8843 + protocol: tcp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.8880 }} + target: 8880 + protocol: tcp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.3478 }} + target: 3478 + protocol: udp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.6789 }} + target: 6789 + protocol: tcp + mode: ingress + - published: {{ omni_compose_apps.unifi.published.ports.10001 }} + target: 10001 + protocol: udp + mode: ingress + volumes: + - type: volume + source: unifi-data + target: /unifi + read_only: false + environment: + RUNAS_UID0: "false" + UNIFI_UID: "{{ omni_compose_apps.unifi.account.uid }}" + UNIFI_GID: "{{ omni_compose_apps.unifi.account.uid }}" + TZ: "Americas/New_York" + deploy: + replicas: 1 diff --git a/vars/applications.yml b/vars/applications.yml index 2f15562..9b876bc 100644 --- a/vars/applications.yml +++ b/vars/applications.yml @@ -66,3 +66,21 @@ omni_compose_apps: main: 192.168.101.0/24 versions: default: latest + unifi: + datastore: /appdata/unifi + account: + name: mech_ubnt + uid: 1296 + published: + ports: + 8080: 8080 + 8443: 8443 + 8843: 8843 + 8880: 8880 + 3478: 3478 + 6789: 6789 + 10001: 10001 + networks: + main: 192.168.100.0/24 + versions: + default: "5.12"