From a21aa5f91cfa2cf8abc2087feec90060e3d1ac96 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Mon, 22 Mar 2021 13:23:31 +0100
Subject: [PATCH] [constellation] Declare installed apps in configuration

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 group_vars/constellation.yml                          | 10 ++++++++++
 host_vars/constellation-dev.adm.crans.org.yml         | 11 +++++++++++
 .../templates/constellation/settings_local.py.j2      |  7 +++++++
 3 files changed, 28 insertions(+)

diff --git a/group_vars/constellation.yml b/group_vars/constellation.yml
index 97741be9..8e223641 100644
--- a/group_vars/constellation.yml
+++ b/group_vars/constellation.yml
@@ -20,6 +20,16 @@ glob_constellation:
     user: 'constellation'
     password: "{{ vault.constellation_django_db_password }}"
     name: 'constellation'
+  applications:
+    - 'access'
+    - 'billing'
+    - 'dnsmanager'
+    - 'firewall'
+    - 'layers'
+    - 'management'
+    - 'member'
+    - 'topography'
+    - 'unix'
   comnpay:
     tpe: 'VAD-941-415'
     secret: '{{ vault.comnpay_secret }}'
diff --git a/host_vars/constellation-dev.adm.crans.org.yml b/host_vars/constellation-dev.adm.crans.org.yml
index b2c2b6c1..e06871f0 100644
--- a/host_vars/constellation-dev.adm.crans.org.yml
+++ b/host_vars/constellation-dev.adm.crans.org.yml
@@ -8,6 +8,17 @@ loc_constellation:
   database:
     user: 'constellation-dev'
     name: 'constellation-dev'
+    applications:
+      - 'access'
+      - 'billing'
+      - 'dnsmanager'
+      - 'firewall'
+      - 'layers'
+      - 'management'
+      - 'member'
+      - 'topography'
+      - 'unix'
+      - 'debug'
   comnpay:
     tpe: 'HOM-832-854'
     secret: '{{ vault.comnpay_homologation_secret }}'
diff --git a/roles/constellation/templates/constellation/settings_local.py.j2 b/roles/constellation/templates/constellation/settings_local.py.j2
index af90a1b6..2ea12f80 100644
--- a/roles/constellation/templates/constellation/settings_local.py.j2
+++ b/roles/constellation/templates/constellation/settings_local.py.j2
@@ -13,6 +13,13 @@ ADMINS = [{% for admin in constellation.admins %}{{ admin }}, {% endfor %}]
 # The list of hostname the server will respond to.
 ALLOWED_HOSTS = [{% for host in constellation.allowed_hosts %}'{{ host }}', {% endfor %}]
 
+# Installed applications
+LOCAL_APPS = [
+{% for app in constellation.applications %}
+    '{{ app }}',
+{% endfor %}
+]
+
 # The time zone the server is runned in
 TIME_ZONE = 'Europe/Paris'
 
-- 
GitLab