From 6ae3e524034f7179375a4bf7e4376ef4b2dd1e8b Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Wed, 29 Jun 2022 00:17:21 +0200
Subject: [PATCH] Introduce a data_dir variable for unicorn

We've had too many confusions about the actual data directory and
unfortunately there are also inconsistencies. So use the data_dir
variable to mask host specific settings.
---
 unicorn.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/unicorn.yml b/unicorn.yml
index cf990d8..8bf561f 100644
--- a/unicorn.yml
+++ b/unicorn.yml
@@ -4,6 +4,7 @@
   become: true
   vars:
     ansible_python_interpreter: /usr/bin/python3
+    data_dir: "/srv/data"
   roles:
     - role: docker_setup
       vars:
@@ -28,5 +29,5 @@
           - "3478:3478/udp" # STUN service
           - "6789:6789/tcp" # Speed Test (unifi5 only)
         volumes:
-          - "/srv/data/unifi-controller/data:/unifi/data"
-          - "/srv/data/unifi-controller/log:/unifi/log"
+          - "{{ data_dir }}/unifi-controller/data:/unifi/data"
+          - "{{ data_dir }}/unifi-controller/log:/unifi/log"