From 911fe28e0630a171317981e03e6c497698eca3c8 Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Wed, 5 Jan 2022 21:19:49 +0100 Subject: [PATCH] add unifi controller role and playbook --- roles/unifi-controller-docker/tasks/main.yml | 27 ++++++++++++++++++++ unifi.yml | 9 +++++++ 2 files changed, 36 insertions(+) create mode 100644 roles/unifi-controller-docker/tasks/main.yml create mode 100644 unifi.yml diff --git a/roles/unifi-controller-docker/tasks/main.yml b/roles/unifi-controller-docker/tasks/main.yml new file mode 100644 index 0000000..acb31cc --- /dev/null +++ b/roles/unifi-controller-docker/tasks/main.yml @@ -0,0 +1,27 @@ +--- +- name: Install python docker package + apt: + name: python3-docker + state: present + +- name: Setup the docker container for unifi-controller + docker_container: + name: unifi-controller + image: "jacobalberty/unifi:v6.5.55" + state: started + restart_policy: unless-stopped + container_default_behavior: no_defaults + env: + TZ: "Europe/Berlin" + ports: + # These fixed ports are needed. + # https://help.ui.com/hc/en-us/articles/218506997-UniFi-Ports-Used + - "8080:8080/tcp" # Device command/control + - "8443:8443/tcp" # Web interface + API + - "8843:8843/tcp" # HTTPS portal + - "8880:8880/tcp" # HTTP portal + - "3478:3478/udp" # STUN service + - "6789:6789/tcp" # Speed Test (unifi5 only) + volumes: + - "/srv/docker/unifi-controller/data:/unifi/data" + - "/srv/docker/unifi-controller/log:/unifi/log" diff --git a/unifi.yml b/unifi.yml new file mode 100644 index 0000000..8cc5695 --- /dev/null +++ b/unifi.yml @@ -0,0 +1,9 @@ +--- +# this is for a dedicated vm just hosting the unifi controller. +- hosts: unifi.n39.eu + become: true + vars: + ansible_python_interpreter: /usr/bin/python3 + roles: + - unifi-controller-docker + tasks: []