Skip to content

Commit

Permalink
chore(unifi): cleanup and prep for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
netr0m committed Oct 26, 2023
1 parent b981268 commit 9c67d37
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
29 changes: 17 additions & 12 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ infra_use_graylog: true
# Configure PiHole
infra_use_pihole: true
# Configure Unifi Controller
infra_use_unifi: true
infra_use_unifi: false
# Configure wireguard
infra_use_wireguard: true
# Configure Vaultwarden
Expand Down Expand Up @@ -72,17 +72,22 @@ infra_unifi_version: latest
infra_unifi_container_image: "ghcr.io/linuxserver/unifi-controller:{{ infra_unifi_version }}"
# unifi container memory
infra_unifi_container_memory: 4g
# unifi container ports
infra_unifi_container_ports:
admin: 8443
device_comms: 8080
guest_portal_https: 8843
guest_portal_http: 8880
throughput: 6789
stun: 3478
discovery: 10001
l2_discovery: 1900
syslog: 5514
# Middleware for the Unifi container
svc_traefik_extra_middlewares:
unifi-headers-mwr:
headers:
customRequestHeaders:
Authorization: ''
X-Forwarded-Proto: 'https'
# Add a route to the Unifi admin portal (due to network_mode: host on the container)
svc_traefik_extra_hosts:
- name: unifi
subdomain: "{{ infra_unifi_container_hostname }}"
shortname: "unifi"
middlewares: [unifi-headers-mwr, lan-mwr]
protocol: https
ip_addr: "{{ ansible_default_ipv4.address }}"
port: "{{ infra_unifi_container_ports.admin }}"

### Pihole ###
# Directories for Pihole
Expand Down
9 changes: 0 additions & 9 deletions tasks/deploy_unifi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
- "{{ infra_unifi_directories.log.path }}:/config/logs"
- "{{ infra_unifi_directories.data.path }}:/config/data"
network_mode: host
ports:
- "{{ infra_unifi_container_ports.admin | default('8443') }}:8443"
- "{{ infra_unifi_container_ports.device_comms | default('8080') }}:8080"
- "{{ infra_unifi_container_ports.guest_portal_https | default('8843') }}:8843"
- "{{ infra_unifi_container_ports.throughput | default('6789') }}:6789"
- "{{ infra_unifi_container_ports.stun | default('3478') }}:3478/udp"
- "{{ infra_unifi_container_ports.discovery | default('10001') }}:10001/udp"
- "{{ infra_unifi_container_ports.l2_discovery | default('1900') }}:1900/udp"
- "{{ infra_unifi_container_ports.syslog | default('5514') }}:5514/udp"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:{{ infra_unifi_container_ports.device_comms }}"]
interval: 30s
Expand Down
18 changes: 15 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
---
# Environment variables for the Unifi container
infra_unifi_env_vars:
PUID: "{{ infra_user_uid }}"
PGID: "{{ infra_group_gid }}"
TZ: "{{ infra_tz | default('Etc/UTC') }}"
PUID: "{{ infra_user_uid | string }}"
PGID: "{{ infra_group_gid | string }}"
TZ: "{{ infra_tz | default('Etc/UTC') | string }}"

# unifi container ports
infra_unifi_container_ports:
admin: 8443
device_comms: 8080
guest_portal_https: 8843
guest_portal_http: 8880
throughput: 6789
stun: 3478
discovery: 10001
l2_discovery: 1900
syslog: 5514

# Environment variables for the Pihole container
infra_pihole_env_vars:
Expand Down

0 comments on commit 9c67d37

Please sign in to comment.