From d9b65b43beed363fbaab36483aeefe5cb13b6068 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Thu, 24 Aug 2023 13:27:35 +0200 Subject: [PATCH] Manage: Make the tabs configurable Manage has tabs that might not be applicable in every situation (e.g oidc, or resource servers, or provisioning). You can disable certain tabs by adding manage_tabs_enabled to your group_vars and overriding the default list --- roles/manage-server/defaults/main.yml | 7 +++++ roles/manage-server/tasks/main.yml | 26 ++++++++++++++----- .../oauth20_rs.schema.json.j2 | 0 .../oidc10_rp.schema.json.j2 | 0 .../provisioning.schema.json.j2 | 0 .../saml20_idp.schema.json.j2 | 0 .../saml20_sp.schema.json.j2 | 0 .../single_tenant_template.schema.json.j2 | 0 8 files changed, 26 insertions(+), 7 deletions(-) rename roles/manage-server/{files => templates}/metadata_configuration/oauth20_rs.schema.json.j2 (100%) rename roles/manage-server/{files => templates}/metadata_configuration/oidc10_rp.schema.json.j2 (100%) rename roles/manage-server/{files => templates}/metadata_configuration/provisioning.schema.json.j2 (100%) rename roles/manage-server/{files => templates}/metadata_configuration/saml20_idp.schema.json.j2 (100%) rename roles/manage-server/{files => templates}/metadata_configuration/saml20_sp.schema.json.j2 (100%) rename roles/manage-server/{files => templates}/metadata_configuration/single_tenant_template.schema.json.j2 (100%) diff --git a/roles/manage-server/defaults/main.yml b/roles/manage-server/defaults/main.yml index 3cac3d3ac..577953c3e 100644 --- a/roles/manage-server/defaults/main.yml +++ b/roles/manage-server/defaults/main.yml @@ -19,3 +19,10 @@ manage_manage_provision_samlsp_sp_cert: "" manage_manage_provision_samlsp_trusted_proxy: false manage_manage_provision_samlsp_sign: false manage_provision_push: false +manage_tabs_enabled: + - saml20_idp + - saml20_sp + - oidc10_rp + - oauth20_rs + - single_tenant_template + - provisioning diff --git a/roles/manage-server/tasks/main.yml b/roles/manage-server/tasks/main.yml index 76f6d5056..649962166 100644 --- a/roles/manage-server/tasks/main.yml +++ b/roles/manage-server/tasks/main.yml @@ -39,14 +39,27 @@ notify: - "restart manage" -- name: copy and template metadata configuration +- name: copy metadata configuration template: - src: "{{ item }}" - dest: '{{ manage_dir }}/metadata_configuration/{{ item | basename | regex_replace("\.j2","") }}' + src: "metadata_configuration/{{ item }}.schema.json.j2" + dest: "{{ manage_dir }}/metadata_configuration/{{ item }}.schema.json" + owner: manage + group: manage + mode: "0640" + with_items: + - "{{ manage_tabs_enabled }}" + notify: + - "restart manage" + +- name: copy metadata templates + copy: + src: "metadata_templates/{{ item }}.template.json" + dest: "{{ manage_dir }}/metadata_templates/{{ item }}.template.json" owner: manage group: manage - mode: 0640 - with_fileglob: "metadata_configuration/*.j2" + mode: "0640" + with_items: + - "{{ manage_tabs_enabled }}" notify: - "restart manage" @@ -56,10 +69,9 @@ dest: "{{ manage_dir }}" owner: manage group: manage - mode: 0640 + mode: "0640" with_items: - metadata_export - - metadata_templates notify: - "restart manage" diff --git a/roles/manage-server/files/metadata_configuration/oauth20_rs.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/oauth20_rs.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/oauth20_rs.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/oauth20_rs.schema.json.j2 diff --git a/roles/manage-server/files/metadata_configuration/oidc10_rp.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/oidc10_rp.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/oidc10_rp.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/oidc10_rp.schema.json.j2 diff --git a/roles/manage-server/files/metadata_configuration/provisioning.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/provisioning.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/provisioning.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/provisioning.schema.json.j2 diff --git a/roles/manage-server/files/metadata_configuration/saml20_idp.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/saml20_idp.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/saml20_idp.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/saml20_idp.schema.json.j2 diff --git a/roles/manage-server/files/metadata_configuration/saml20_sp.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/saml20_sp.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/saml20_sp.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/saml20_sp.schema.json.j2 diff --git a/roles/manage-server/files/metadata_configuration/single_tenant_template.schema.json.j2 b/roles/manage-server/templates/metadata_configuration/single_tenant_template.schema.json.j2 similarity index 100% rename from roles/manage-server/files/metadata_configuration/single_tenant_template.schema.json.j2 rename to roles/manage-server/templates/metadata_configuration/single_tenant_template.schema.json.j2