Commit 098d90ab authored by Arie Peterson's avatar Arie Peterson

Enable apps in settings configmap

parent f71df991
......@@ -86,3 +86,14 @@ local_flux: false
flux_source:
repo: "https://open.greenhost.net/openappstack/openappstack"
branch: "master"
# A whitelist of applications that will be enabled.
enabled_applications:
- 'cert-manager'
- 'ingress'
- 'local-storage'
- 'monitoring'
- 'nextcloud'
- 'rocketchat'
- 'single-sign-on'
- 'wordpress'
......@@ -52,7 +52,7 @@
- cert-manager
vars:
flux:
name: "cert-manager-settings"
name: "cert-manager"
namespace: "oas"
include_tasks:
file: flux_secret.yml
......
......@@ -11,6 +11,7 @@
kind: Secret
metadata:
namespace: "{{ flux.namespace | default('oas-apps') }}"
name: "{{ flux.name }}"
name: "{{ flux.name }}-settings"
data:
values.yaml: "{{ lookup('template','{{ flux.name }}.yaml') | b64encode }}"
values.yaml: "{{ lookup('template','settings/{{ flux.name }}.yaml') | b64encode }}"
enabled: "{{ (flux.name in enabled_applications) | ternary('true', 'false') | b64encode }}"
......@@ -6,7 +6,7 @@
- local-storage
vars:
flux:
name: "local-storage-settings"
name: "local-storage"
namespace: "oas"
include_tasks:
file: flux_secret.yml
......
......@@ -6,7 +6,7 @@
- nextcloud
vars:
flux:
name: "nextcloud-settings"
name: "nextcloud"
include_tasks:
file: flux_secret.yml
apply:
......
......@@ -7,7 +7,7 @@
- nginx
vars:
flux:
name: "ingress-settings"
name: "ingress"
namespace: "oas"
include_tasks:
file: flux_secret.yml
......
......@@ -38,7 +38,7 @@
- prometheus
vars:
flux:
name: "monitoring-settings"
name: "monitoring"
namespace: "oas"
include_tasks:
file: flux_secret.yml
......
......@@ -7,7 +7,7 @@
- rocketchat
vars:
flux:
name: "rocketchat-settings"
name: "rocketchat"
include_tasks:
file: flux_secret.yml
apply:
......
......@@ -7,7 +7,7 @@
- single-sign-on
vars:
flux:
name: "single-sign-on-settings"
name: "single-sign-on"
namespace: "oas"
include_tasks:
file: flux_secret.yml
......
......@@ -6,7 +6,7 @@
- wordpress
vars:
flux:
name: "wordpress-settings"
name: "wordpress"
include_tasks:
file: flux_secret.yml
apply:
......
version: 1
commandUpdated:
generators:
# Find all yaml files in this directory (recursively). Ignore ones with
# filename starting with a dot. For each of them, check if the
# `application-list` configmap has blacklisted the app in the form of an
# entry with key the app name and value "false", and skip it if so.
# Find all yaml files (recursively) in the directories oas and oas-apps.
# Ignore ones with filename starting with a dot. For each of them, check if
# the corresponding settings configmap has disabled the app by having a key
# "enabled" with value "false", and skip it in that case.
- command: >
for path in $(find . -type f \( -name '*.yaml' -o -name '*.yml' \) -a ! -name '.*'); do
filename=$(basename $path);
name="${filename%.*}";
userOverride=$(kubectl get cm -n oas application-list -o jsonpath="{.data.$name}");
if [ "$userOverride" == "false" ]; then continue; fi;
echo '---';
cat $path;
for namespace in "oas" "oas-apps"; do
for path in $(find "$namespace" -type f \( -name '*.yaml' -o -name '*.yml' \) -a ! -name '.*'); do
filename=$(basename $path);
name="${filename%.*}";
enabled=$(kubectl get secret -n "$namespace" "${name}-settings" -o jsonpath="{.data.enabled}");
if [ "$enabled" == "false" ]; then continue; fi;
echo '---';
cat $path;
done;
done
updaters:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment