From 1fd7f667836ede0afb3da89ba6d12270b37d7dfe Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 23 Aug 2017 07:13:20 -0500 Subject: [PATCH] Helm-Toolkit: Configmap templater This PS adds a configmap teplater helper to helm-toolkit. It makes it simpler to write consistent charts that supports over-riding of all values. Change-Id: I9a587999859ea02802485eb25a3f0ebec8c712a8 --- barbican/templates/configmap-etc.yaml | 44 +---- barbican/values.yaml | 3 + cinder/templates/configmap-etc.yaml | 54 +----- glance/templates/configmap-etc.yaml | 66 +------ heat/templates/configmap-etc.yaml | 30 +--- .../templates/utils/_configmap_templater.tpl | 32 ++++ keystone/templates/configmap-etc.yaml | 48 +---- keystone/values.yaml | 9 + magnum/templates/configmap-etc.yaml | 30 +--- mistral/templates/configmap-etc.yaml | 24 +-- neutron/templates/configmap-etc.yaml | 168 ++---------------- nova/templates/configmap-etc.yaml | 46 +---- nova/values.yaml | 6 + senlin/templates/configmap-etc.yaml | 30 +--- 14 files changed, 104 insertions(+), 486 deletions(-) create mode 100644 helm-toolkit/templates/utils/_configmap_templater.tpl diff --git a/barbican/templates/configmap-etc.yaml b/barbican/templates/configmap-etc.yaml index 484cdc2af3..6a6ffad676 100644 --- a/barbican/templates/configmap-etc.yaml +++ b/barbican/templates/configmap-etc.yaml @@ -70,47 +70,13 @@ metadata: name: barbican-etc data: barbican.conf: |+ -{{ if .Values.conf.barbican.override -}} -{{ .Values.conf.barbican.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.barbican.prefix -}} -{{ .Values.conf.barbican.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_barbican.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.barbican.append -}} -{{ .Values.conf.barbican.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.barbican "etc/_barbican.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} barbican-api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_barbican-api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_barbican-api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api_audit_map.conf: |+ -{{ if .Values.conf.audit_map.override -}} -{{ .Values.conf.audit_map.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.audit_map.prefix -}} -{{ .Values.conf.audit_map.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api_audit_map.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.audit_map.append -}} -{{ .Values.conf.audit_map.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.audit_map "etc/_api_audit_map.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.override "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} barbican-api.ini: |+ -{{ tuple "etc/_barbican-api.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.barbican_api "etc/_barbican-api.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/barbican/values.yaml b/barbican/values.yaml index 9cef050b8a..5471a1fdaa 100644 --- a/barbican/values.yaml +++ b/barbican/values.yaml @@ -177,6 +177,9 @@ conf: audit_map: override: append: + barbican_api: + override: + append: barbican: override: append: diff --git a/cinder/templates/configmap-etc.yaml b/cinder/templates/configmap-etc.yaml index 2e082ec413..4268d9f079 100644 --- a/cinder/templates/configmap-etc.yaml +++ b/cinder/templates/configmap-etc.yaml @@ -70,29 +70,9 @@ metadata: name: cinder-etc data: rally_tests.yaml: |+ -{{ if .Values.conf.rally_tests.override -}} -{{ .Values.conf.rally_tests.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rally_tests.prefix -}} -{{ .Values.conf.rally_tests.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rally_tests.append -}} -{{ .Values.conf.rally_tests.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} cinder.conf: |+ -{{ if .Values.conf.cinder.override -}} -{{ .Values.conf.cinder.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.cinder.prefix -}} -{{ .Values.conf.cinder.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_cinder.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.cinder.append -}} -{{ .Values.conf.cinder.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.cinder "etc/_cinder.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} backends.conf: |+ {{ if .Values.conf.backends.override -}} {{ .Values.conf.backends.override | indent 4 }} @@ -106,33 +86,9 @@ data: {{ .Values.conf.backends.append | indent 4 }} {{- end }} rootwrap.conf: |+ -{{ if .Values.conf.rootwrap.override -}} -{{ .Values.conf.rootwrap.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rootwrap.prefix -}} -{{ .Values.conf.rootwrap.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rootwrap.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rootwrap.append -}} -{{ .Values.conf.rootwrap.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rootwrap "etc/_rootwrap.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/glance/templates/configmap-etc.yaml b/glance/templates/configmap-etc.yaml index 22c214aa43..b2aaef8f1a 100644 --- a/glance/templates/configmap-etc.yaml +++ b/glance/templates/configmap-etc.yaml @@ -117,69 +117,15 @@ metadata: name: glance-etc data: rally_tests.yaml: |+ -{{ if .Values.conf.rally_tests.override -}} -{{ .Values.conf.rally_tests.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rally_tests.prefix -}} -{{ .Values.conf.rally_tests.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rally_tests.append -}} -{{ .Values.conf.rally_tests.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} glance-api.conf: |+ -{{ if .Values.conf.glance.override -}} -{{ .Values.conf.glance.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.glance.prefix -}} -{{ .Values.conf.glance.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_glance-api.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.glance.append -}} -{{ .Values.conf.glance.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.glance "etc/_glance-api.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} glance-api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_glance-api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_glance-api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} glance-registry.conf: |+ -{{ if .Values.conf.glance_registry.override -}} -{{ .Values.conf.glance_registry.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.glance_registry.prefix -}} -{{ .Values.conf.glance_registry.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_glance-registry.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.glance_registry.append -}} -{{ .Values.conf.glance_registry.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.glance_registry "etc/_glance-registry.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} glance-registry-paste.ini: |+ -{{ if .Values.conf.paste_registry.override -}} -{{ .Values.conf.paste_registry.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste_registry.prefix -}} -{{ .Values.conf.paste_registry.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_glance-registry-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste_registry.append -}} -{{ .Values.conf.paste_registry.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste_registry "etc/_glance-registry-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/heat/templates/configmap-etc.yaml b/heat/templates/configmap-etc.yaml index f94ceb2f20..4223045b22 100644 --- a/heat/templates/configmap-etc.yaml +++ b/heat/templates/configmap-etc.yaml @@ -115,33 +115,9 @@ metadata: name: heat-etc data: heat.conf: |+ -{{ if .Values.conf.heat.override -}} -{{ .Values.conf.heat.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.heat.prefix -}} -{{ .Values.conf.heat.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_heat.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.heat.append -}} -{{ .Values.conf.heat.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.heat "etc/_heat.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/helm-toolkit/templates/utils/_configmap_templater.tpl b/helm-toolkit/templates/utils/_configmap_templater.tpl new file mode 100644 index 0000000000..9f168b18ea --- /dev/null +++ b/helm-toolkit/templates/utils/_configmap_templater.tpl @@ -0,0 +1,32 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- define "helm-toolkit.utils.configmap_templater" }} +{{- $keyRoot := index . 0 -}} +{{- $configTemplate := index . 1 -}} +{{- $context := index . 2 -}} +{{ if $keyRoot.override -}} +{{ $keyRoot.override | indent 4 }} +{{- else -}} +{{- if $keyRoot.prefix -}} +{{ $keyRoot.prefix | indent 4 }} +{{- end }} +{{ tuple $configTemplate $context | include "helm-toolkit.utils.template" | indent 4 }} +{{- end }} +{{- if $keyRoot.append -}} +{{ $keyRoot.append | indent 4 }} +{{- end }} +{{- end -}} diff --git a/keystone/templates/configmap-etc.yaml b/keystone/templates/configmap-etc.yaml index bd37f7da3d..36207353a1 100644 --- a/keystone/templates/configmap-etc.yaml +++ b/keystone/templates/configmap-etc.yaml @@ -38,51 +38,17 @@ metadata: name: keystone-etc data: rally_tests.yaml: |+ -{{ if .Values.conf.rally_tests.override -}} -{{ .Values.conf.rally_tests.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rally_tests.prefix -}} -{{ .Values.conf.rally_tests.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rally_tests.append -}} -{{ .Values.conf.rally_tests.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} keystone.conf: |+ -{{ if .Values.conf.keystone.override -}} -{{ .Values.conf.keystone.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.keystone.prefix -}} -{{ .Values.conf.keystone.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_keystone.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.keystone.append -}} -{{ .Values.conf.keystone.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.keystone "etc/_keystone.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} keystone-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_keystone-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_keystone-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} mpm_event.conf: |+ -{{ tuple "etc/_mpm_event.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.mpm_event "etc/_mpm_event.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} wsgi-keystone.conf: |+ -{{ tuple "etc/_wsgi-keystone.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.wsgi_keystone "etc/_wsgi-keystone.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} sso_callback_template.html: |+ -{{ tuple "etc/_sso_callback_template.html.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.sso_callback_template "etc/_sso_callback_template.html.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/keystone/values.yaml b/keystone/values.yaml index bf0358b03b..320cb0eada 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -250,6 +250,15 @@ conf: policy: override: append: + mpm_event: + override: + append: + wsgi_keystone: + override: + append: + sso_callback_template: + override: + append: keystone: override: append: diff --git a/magnum/templates/configmap-etc.yaml b/magnum/templates/configmap-etc.yaml index 598b6cd717..fe882ddc29 100644 --- a/magnum/templates/configmap-etc.yaml +++ b/magnum/templates/configmap-etc.yaml @@ -66,33 +66,9 @@ metadata: name: magnum-etc data: magnum.conf: |+ -{{ if .Values.conf.magnum.override -}} -{{ .Values.conf.magnum.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.magnum.prefix -}} -{{ .Values.conf.magnum.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_magnum.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.magnum.append -}} -{{ .Values.conf.magnum.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.magnum "etc/_magnum.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/mistral/templates/configmap-etc.yaml b/mistral/templates/configmap-etc.yaml index cf01782b23..9197994712 100644 --- a/mistral/templates/configmap-etc.yaml +++ b/mistral/templates/configmap-etc.yaml @@ -65,27 +65,7 @@ metadata: name: mistral-etc data: mistral.conf: |+ -{{ if .Values.conf.mistral.override -}} -{{ .Values.conf.mistral.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.mistral.prefix -}} -{{ .Values.conf.mistral.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_mistral.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.mistral.append -}} -{{ .Values.conf.mistral.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.mistral "etc/_mistral.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.policy.prefix -}} -{{ .Values.conf.policy.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.policy.append -}} -{{ .Values.conf.policy.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/neutron/templates/configmap-etc.yaml b/neutron/templates/configmap-etc.yaml index 8441428639..8442c9f06e 100644 --- a/neutron/templates/configmap-etc.yaml +++ b/neutron/templates/configmap-etc.yaml @@ -84,172 +84,32 @@ metadata: name: neutron-etc data: rally_tests.yaml: |+ -{{ if .Values.conf.rally_tests.override -}} -{{ .Values.conf.rally_tests.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rally_tests.prefix -}} -{{ .Values.conf.rally_tests.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rally_tests.append -}} -{{ .Values.conf.rally_tests.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.policy.prefix -}} -{{ .Values.conf.policy.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.policy.append -}} -{{ .Values.conf.policy.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} dhcp_agent.ini: |+ -{{ if .Values.conf.dhcp_agent.override -}} -{{ .Values.conf.dhcp_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.dhcp_agent.prefix -}} -{{ .Values.conf.dhcp_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_dhcp_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.dhcp_agent.append -}} -{{ .Values.conf.dhcp_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.dhcp_agent "etc/_dhcp_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} l3_agent.ini: |+ -{{ if .Values.conf.l3_agent.override -}} -{{ .Values.conf.l3_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.l3_agent.prefix -}} -{{ .Values.conf.l3_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_l3_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.l3_agent.append -}} -{{ .Values.conf.l3_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.l3_agent "etc/_l3_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} metadata_agent.ini: |+ -{{ if .Values.conf.metadata_agent.override -}} -{{ .Values.conf.metadata_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.metadata_agent.prefix -}} -{{ .Values.conf.metadata_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_metadata_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.metadata_agent.append -}} -{{ .Values.conf.metadata_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.metadata_agent "etc/_metadata_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} metering_agent.ini: |+ -{{ if .Values.conf.metering_agent.override -}} -{{ .Values.conf.metering_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.metering_agent.prefix -}} -{{ .Values.conf.metering_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_metering_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.metering_agent.append -}} -{{ .Values.conf.metering_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.metering_agent "etc/_metering_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} neutron.conf: |+ -{{ if .Values.conf.neutron.override -}} -{{ .Values.conf.neutron.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.neutron.prefix -}} -{{ .Values.conf.neutron.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_neutron.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.neutron.append -}} -{{ .Values.conf.neutron.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.neutron "etc/_neutron.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} ml2_conf.ini: |+ -{{ if .Values.conf.ml2_conf.override -}} -{{ .Values.conf.ml2_conf.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.ml2_conf.prefix -}} -{{ .Values.conf.ml2_conf.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_ml2_conf.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.ml2_conf.append -}} -{{ .Values.conf.ml2_conf.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.ml2_conf "etc/plugins/_ml2_conf.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} ml2_conf_sriov.ini: |+ -{{ if .Values.conf.ml2_conf_sriov.override -}} -{{ .Values.conf.ml2_conf_sriov.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.ml2_conf_sriov.prefix -}} -{{ .Values.conf.ml2_conf_sriov.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_ml2_conf_sriov.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.ml2_conf_sriov.append -}} -{{ .Values.conf.ml2_conf_sriov.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.ml2_conf_sriov "etc/plugins/_ml2_conf_sriov.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} macvtap_agent.ini: |+ -{{ if .Values.conf.macvtap_agent.override -}} -{{ .Values.conf.macvtap_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.macvtap_agent.prefix -}} -{{ .Values.conf.macvtap_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_macvtap_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.macvtap_agent.append -}} -{{ .Values.conf.macvtap_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.macvtap_agent "etc/plugins/_macvtap_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} linuxbridge_agent.ini: |+ -{{ if .Values.conf.linuxbridge_agent.override -}} -{{ .Values.conf.linuxbridge_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.linuxbridge_agent.prefix -}} -{{ .Values.conf.linuxbridge_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_linuxbridge_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.linuxbridge_agent.append -}} -{{ .Values.conf.linuxbridge_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.linuxbridge_agent "etc/plugins/_linuxbridge_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} openvswitch_agent.ini: |+ -{{ if .Values.conf.openvswitch_agent.override -}} -{{ .Values.conf.openvswitch_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.openvswitch_agent.prefix -}} -{{ .Values.conf.openvswitch_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_openvswitch_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.openvswitch_agent.append -}} -{{ .Values.conf.openvswitch_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.openvswitch_agent "etc/plugins/_openvswitch_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} sriov_agent.ini: |+ -{{ if .Values.conf.sriov_agent.override -}} -{{ .Values.conf.sriov_agent.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.sriov_agent.prefix -}} -{{ .Values.conf.sriov_agent.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/plugins/_sriov_agent.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.sriov_agent.append -}} -{{ .Values.conf.sriov_agent.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.sriov_agent "etc/plugins/_sriov_agent.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} dnsmasq.conf: "" {{- end }} diff --git a/nova/templates/configmap-etc.yaml b/nova/templates/configmap-etc.yaml index f5904f57f6..e1e9aab832 100644 --- a/nova/templates/configmap-etc.yaml +++ b/nova/templates/configmap-etc.yaml @@ -94,49 +94,15 @@ metadata: name: nova-etc data: rally_tests.yaml: |+ -{{ if .Values.conf.rally_tests.override -}} -{{ .Values.conf.rally_tests.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.rally_tests.prefix -}} -{{ .Values.conf.rally_tests.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.rally_tests.append -}} -{{ .Values.conf.rally_tests.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} nova.conf: |+ -{{ if .Values.conf.nova.override -}} -{{ .Values.conf.nova.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.nova.prefix -}} -{{ .Values.conf.nova.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_nova.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.nova.append -}} -{{ .Values.conf.nova.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.nova "etc/_nova.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.yaml: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} libvirtd.conf: |+ -{{ tuple "etc/_libvirtd.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.libvirtd "etc/_libvirtd.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} qemu.conf: |+ -{{ tuple "etc/_qemu.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- tuple .Values.conf.qemu "etc/_qemu.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }} diff --git a/nova/values.yaml b/nova/values.yaml index fe570490ea..6944a9b624 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -276,6 +276,12 @@ conf: policy: override: append: + libvirtd: + override: + append: + qemu: + override: + append: nova: override: append: diff --git a/senlin/templates/configmap-etc.yaml b/senlin/templates/configmap-etc.yaml index 42aad551cb..fcefcd384c 100644 --- a/senlin/templates/configmap-etc.yaml +++ b/senlin/templates/configmap-etc.yaml @@ -66,33 +66,9 @@ metadata: name: senlin-etc data: senlin.conf: |+ -{{ if .Values.conf.senlin.override -}} -{{ .Values.conf.senlin.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.senlin.prefix -}} -{{ .Values.conf.senlin.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_senlin.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.senlin.append -}} -{{ .Values.conf.senlin.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.senlin "etc/_senlin.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} api-paste.ini: |+ -{{ if .Values.conf.paste.override -}} -{{ .Values.conf.paste.override | indent 4 }} -{{- else -}} -{{- if .Values.conf.paste.prefix -}} -{{ .Values.conf.paste.prefix | indent 4 }} -{{- end }} -{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.paste.append -}} -{{ .Values.conf.paste.append | indent 4 }} -{{- end }} +{{- tuple .Values.conf.paste "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.configmap_templater" }} policy.json: |+ -{{ if .Values.conf.policy.override -}} -{{ .Values.conf.policy.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_policy.json.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} +{{- tuple .Values.conf.policy "etc/_policy.json.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- end }}