diff --git a/barbican/templates/etc/_barbican.conf.tpl b/barbican/templates/etc/_barbican.conf.tpl
index db07ea5dbc..9b6f0e75f7 100644
--- a/barbican/templates/etc/_barbican.conf.tpl
+++ b/barbican/templates/etc/_barbican.conf.tpl
@@ -696,7 +696,8 @@
 
 # List of certificate plugins to load. (multi valued)
 # from .certificate.barbican.certificate.plugin.enabled_certificate_plugins (multiopt)
-{{ if not .certificate.barbican.certificate.plugin.enabled_certificate_plugins }}#enabled_certificate_plugins = {{ .certificate.barbican.certificate.plugin.enabled_certificate_plugins | default "simple_certificate" }}{{ else }}{{ range .certificate.barbican.certificate.plugin.enabled_certificate_plugins }}enabled_certificate_plugins = {{ . }}{{ end }}{{ end }}
+{{ if not .certificate.barbican.certificate.plugin.enabled_certificate_plugins }}#enabled_certificate_plugins = {{ .certificate.barbican.certificate.plugin.enabled_certificate_plugins | default "simple_certificate" }}{{ else }}{{ range .certificate.barbican.certificate.plugin.enabled_certificate_plugins }}enabled_certificate_plugins = {{ . }}
+{{ end }}{{ end }}
 
 
 [certificate_event]
@@ -711,7 +712,8 @@
 
 # List of certificate plugins to load. (multi valued)
 # from .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins (multiopt)
-{{ if not .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins }}#enabled_certificate_event_plugins = {{ .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins | default "simple_certificate_event" }}{{ else }}{{ range .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins }}enabled_certificate_event_plugins = {{ . }}{{ end }}{{ end }}
+{{ if not .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins }}#enabled_certificate_event_plugins = {{ .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins | default "simple_certificate_event" }}{{ else }}{{ range .certificate_event.barbican.certificate.plugin.enabled_certificate_event_plugins }}enabled_certificate_event_plugins = {{ . }}
+{{ end }}{{ end }}
 
 
 [cors]
@@ -802,7 +804,8 @@
 
 # List of crypto plugins to load. (multi valued)
 # from .crypto.barbican.plugin.crypto.enabled_crypto_plugins (multiopt)
-{{ if not .crypto.barbican.plugin.crypto.enabled_crypto_plugins }}#enabled_crypto_plugins = {{ .crypto.barbican.plugin.crypto.enabled_crypto_plugins | default "simple_crypto" }}{{ else }}{{ range .crypto.barbican.plugin.crypto.enabled_crypto_plugins }}enabled_crypto_plugins = {{ . }}{{ end }}{{ end }}
+{{ if not .crypto.barbican.plugin.crypto.enabled_crypto_plugins }}#enabled_crypto_plugins = {{ .crypto.barbican.plugin.crypto.enabled_crypto_plugins | default "simple_crypto" }}{{ else }}{{ range .crypto.barbican.plugin.crypto.enabled_crypto_plugins }}enabled_crypto_plugins = {{ . }}
+{{ end }}{{ end }}
 
 
 [keystone_authtoken]
@@ -1417,9 +1420,11 @@
 # 'notify'   - Send Notifications pre-settled
 #  (multi valued)
 # from .oslo_messaging_amqp.oslo.messaging.pre_settled (multiopt)
-{{ if not .oslo_messaging_amqp.oslo.messaging.pre_settled }}#pre_settled = {{ .oslo_messaging_amqp.oslo.messaging.pre_settled | default "rpc-cast" }}{{ else }}{{ range .oslo_messaging_amqp.oslo.messaging.pre_settled }}pre_settled = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_amqp.oslo.messaging.pre_settled }}#pre_settled = {{ .oslo_messaging_amqp.oslo.messaging.pre_settled | default "rpc-cast" }}{{ else }}{{ range .oslo_messaging_amqp.oslo.messaging.pre_settled }}pre_settled = {{ . }}
+{{ end }}{{ end }}
 # from .oslo_messaging_amqp.oslo.messaging.pre_settled (multiopt)
-{{ if not .oslo_messaging_amqp.oslo.messaging.pre_settled }}#pre_settled = {{ .oslo_messaging_amqp.oslo.messaging.pre_settled | default "rpc-reply" }}{{ else }}{{ range .oslo_messaging_amqp.oslo.messaging.pre_settled }}pre_settled = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_amqp.oslo.messaging.pre_settled }}#pre_settled = {{ .oslo_messaging_amqp.oslo.messaging.pre_settled | default "rpc-reply" }}{{ else }}{{ range .oslo_messaging_amqp.oslo.messaging.pre_settled }}pre_settled = {{ . }}
+{{ end }}{{ end }}
 
 
 [oslo_messaging_kafka]
@@ -1491,7 +1496,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If
 # not set, we fall back to the same configuration used for RPC.
@@ -2074,7 +2080,8 @@
 # Missing or empty directories are ignored. (multi valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [p11_crypto_plugin]
@@ -2228,7 +2235,8 @@
 
 # List of secret store plugins to load. (multi valued)
 # from .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins (multiopt)
-{{ if not .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins }}#enabled_secretstore_plugins = {{ .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins | default "store_crypto" }}{{ else }}{{ range .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins }}enabled_secretstore_plugins = {{ . }}{{ end }}{{ end }}
+{{ if not .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins }}#enabled_secretstore_plugins = {{ .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins | default "store_crypto" }}{{ else }}{{ range .secretstore.barbican.plugin.secret_store.enabled_secretstore_plugins }}enabled_secretstore_plugins = {{ . }}
+{{ end }}{{ end }}
 
 # Flag to enable multiple secret store plugin backend support. Default
 # is False (boolean value)
diff --git a/cinder/templates/etc/_cinder.conf.tpl b/cinder/templates/etc/_cinder.conf.tpl
index 97aa3af296..ad12aee65e 100644
--- a/cinder/templates/etc/_cinder.conf.tpl
+++ b/cinder/templates/etc/_cinder.conf.tpl
@@ -308,7 +308,8 @@
 
 # osapi volume extension to load (multi valued)
 # from .default.cinder.osapi_volume_extension (multiopt)
-{{ if not .default.cinder.osapi_volume_extension }}#osapi_volume_extension = {{ .default.cinder.osapi_volume_extension | default "cinder.api.contrib.standard_extensions" }}{{ else }}{{ range .default.cinder.osapi_volume_extension }}osapi_volume_extension = {{ . }}{{ end }}{{ end }}
+{{ if not .default.cinder.osapi_volume_extension }}#osapi_volume_extension = {{ .default.cinder.osapi_volume_extension | default "cinder.api.contrib.standard_extensions" }}{{ else }}{{ range .default.cinder.osapi_volume_extension }}osapi_volume_extension = {{ . }}
+{{ end }}{{ end }}
 
 # Full class name for the Manager for volume (string value)
 # from .default.cinder.volume_manager
@@ -887,7 +888,8 @@
 # takes the standard dict config form: replication_device =
 # target_device_id:<required>,key1:value1,key2:value2... (dict value)
 # from .default.cinder.replication_device (multiopt)
-{{ if not .default.cinder.replication_device }}#replication_device = {{ .default.cinder.replication_device | default "<None>" }}{{ else }}{{ range .default.cinder.replication_device }}replication_device = {{ . }}{{ end }}{{ end }}
+{{ if not .default.cinder.replication_device }}#replication_device = {{ .default.cinder.replication_device | default "<None>" }}{{ else }}{{ range .default.cinder.replication_device }}replication_device = {{ . }}
+{{ end }}{{ end }}
 
 # If set to True, upload-to-image in raw format will create a cloned
 # volume and register its location to the image service, instead of
@@ -2620,7 +2622,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If
 # not set, we fall back to the same configuration used for RPC.
@@ -3129,7 +3132,8 @@
 # Missing or empty directories are ignored. (multi valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [oslo_reports]
diff --git a/glance/templates/etc/_glance-api.conf.tpl b/glance/templates/etc/_glance-api.conf.tpl
index 44da10a784..28754ea696 100644
--- a/glance/templates/etc/_glance-api.conf.tpl
+++ b/glance/templates/etc/_glance-api.conf.tpl
@@ -2805,7 +2805,8 @@
 #
 #  (multi valued)
 # from .glance_store.glance.store.filesystem_store_datadirs (multiopt)
-{{ if not .glance_store.glance.store.filesystem_store_datadirs }}#filesystem_store_datadirs = {{ .glance_store.glance.store.filesystem_store_datadirs | default "" }}{{ else }}{{ range .glance_store.glance.store.filesystem_store_datadirs }}filesystem_store_datadirs = {{ . }}{{ end }}{{ end }}
+{{ if not .glance_store.glance.store.filesystem_store_datadirs }}#filesystem_store_datadirs = {{ .glance_store.glance.store.filesystem_store_datadirs | default "" }}{{ else }}{{ range .glance_store.glance.store.filesystem_store_datadirs }}filesystem_store_datadirs = {{ . }}
+{{ end }}{{ end }}
 
 #
 # Filesystem store metadata file.
@@ -3457,7 +3458,8 @@
 #
 #  (multi valued)
 # from .glance_store.glance.store.vmware_datastores (multiopt)
-{{ if not .glance_store.glance.store.vmware_datastores }}#vmware_datastores = {{ .glance_store.glance.store.vmware_datastores | default "" }}{{ else }}{{ range .glance_store.glance.store.vmware_datastores }}vmware_datastores = {{ . }}{{ end }}{{ end }}
+{{ if not .glance_store.glance.store.vmware_datastores }}#vmware_datastores = {{ .glance_store.glance.store.vmware_datastores | default "" }}{{ else }}{{ range .glance_store.glance.store.vmware_datastores }}vmware_datastores = {{ . }}
+{{ end }}{{ end }}
 
 
 [image_format]
@@ -3945,7 +3947,8 @@
 # messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -4421,7 +4424,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [paste_deploy]
diff --git a/glance/templates/etc/_glance-registry.conf.tpl b/glance/templates/etc/_glance-registry.conf.tpl
index d9bf36579a..6faa084d84 100644
--- a/glance/templates/etc/_glance-registry.conf.tpl
+++ b/glance/templates/etc/_glance-registry.conf.tpl
@@ -1737,7 +1737,8 @@
 # messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -2201,7 +2202,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [paste_deploy]
diff --git a/heat/templates/etc/_heat.conf.tpl b/heat/templates/etc/_heat.conf.tpl
index dd026ef52a..b1e1dc97bc 100644
--- a/heat/templates/etc/_heat.conf.tpl
+++ b/heat/templates/etc/_heat.conf.tpl
@@ -2262,7 +2262,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -2755,7 +2756,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [paste_deploy]
diff --git a/keystone/templates/etc/_keystone.conf.tpl b/keystone/templates/etc/_keystone.conf.tpl
index ded7991088..b6c9114b41 100644
--- a/keystone/templates/etc/_keystone.conf.tpl
+++ b/keystone/templates/etc/_keystone.conf.tpl
@@ -281,7 +281,8 @@
 # topics. For example: notification_opt_out=identity.user.create
 # notification_opt_out=identity.authenticate.success (multi valued)
 # from .default.keystone.notification_opt_out (multiopt)
-{{ if not .default.keystone.notification_opt_out }}#notification_opt_out = {{ .default.keystone.notification_opt_out | default "" }}{{ else }}{{ range .default.keystone.notification_opt_out }}notification_opt_out = {{ . }}{{ end }}{{ end }}
+{{ if not .default.keystone.notification_opt_out }}#notification_opt_out = {{ .default.keystone.notification_opt_out | default "" }}{{ else }}{{ range .default.keystone.notification_opt_out }}notification_opt_out = {{ . }}
+{{ end }}{{ end }}
 
 #
 # From oslo.log
@@ -646,7 +647,8 @@
 # argument to be passed to the dogpile.cache backend. Example format:
 # "<argname>:<value>". (multi valued)
 # from .cache.oslo.cache.backend_argument (multiopt)
-{{ if not .cache.oslo.cache.backend_argument }}#backend_argument = {{ .cache.oslo.cache.backend_argument | default "" }}{{ else }}{{ range .cache.oslo.cache.backend_argument }}backend_argument = {{ . }}{{ end }}{{ end }}
+{{ if not .cache.oslo.cache.backend_argument }}#backend_argument = {{ .cache.oslo.cache.backend_argument | default "" }}{{ else }}{{ range .cache.oslo.cache.backend_argument }}backend_argument = {{ . }}
+{{ end }}{{ end }}
 
 # Proxy classes to import that will affect the way the dogpile.cache backend
 # functions. See the dogpile.cache documentation on changing-backend-behavior.
@@ -1128,7 +1130,8 @@
 # trusted_dashboard=https://acme.example.com/auth/websso
 # trusted_dashboard=https://beta.example.com/auth/websso (multi valued)
 # from .federation.keystone.trusted_dashboard (multiopt)
-{{ if not .federation.keystone.trusted_dashboard }}#trusted_dashboard = {{ .federation.keystone.trusted_dashboard | default "" }}{{ else }}{{ range .federation.keystone.trusted_dashboard }}trusted_dashboard = {{ . }}{{ end }}{{ end }}
+{{ if not .federation.keystone.trusted_dashboard }}#trusted_dashboard = {{ .federation.keystone.trusted_dashboard | default "" }}{{ else }}{{ range .federation.keystone.trusted_dashboard }}trusted_dashboard = {{ . }}
+{{ end }}{{ end }}
 
 # Absolute path to an HTML file used as a Single Sign-On callback handler. This
 # page is expected to redirect the user from keystone back to a trusted
@@ -2114,7 +2117,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -2607,7 +2611,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [paste_deploy]
@@ -3282,7 +3287,8 @@
 # two different DNs, such as `trusted_issuer = CN=john,OU=keystone,O=openstack`
 # and `trusted_issuer = CN=mary,OU=eng,O=abc`. (multi valued)
 # from .tokenless_auth.keystone.trusted_issuer (multiopt)
-{{ if not .tokenless_auth.keystone.trusted_issuer }}#trusted_issuer = {{ .tokenless_auth.keystone.trusted_issuer | default "" }}{{ else }}{{ range .tokenless_auth.keystone.trusted_issuer }}trusted_issuer = {{ . }}{{ end }}{{ end }}
+{{ if not .tokenless_auth.keystone.trusted_issuer }}#trusted_issuer = {{ .tokenless_auth.keystone.trusted_issuer | default "" }}{{ else }}{{ range .tokenless_auth.keystone.trusted_issuer }}trusted_issuer = {{ . }}
+{{ end }}{{ end }}
 
 # The federated protocol ID used to represent X.509 tokenless authorization.
 # This is used in combination with the value of `[tokenless_auth]
diff --git a/magnum/templates/etc/_magnum.conf.tpl b/magnum/templates/etc/_magnum.conf.tpl
index c78d080c45..7a40760286 100644
--- a/magnum/templates/etc/_magnum.conf.tpl
+++ b/magnum/templates/etc/_magnum.conf.tpl
@@ -1556,7 +1556,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -2023,7 +2024,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [trust]
diff --git a/mistral/templates/etc/_mistral.conf.tpl b/mistral/templates/etc/_mistral.conf.tpl
index aaea3b0fd1..885553f823 100644
--- a/mistral/templates/etc/_mistral.conf.tpl
+++ b/mistral/templates/etc/_mistral.conf.tpl
@@ -1196,7 +1196,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If
 # not set, we fall back to the same configuration used for RPC.
@@ -1679,7 +1680,8 @@
 # Missing or empty directories are ignored. (multi valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [pecan]
diff --git a/neutron/templates/etc/_metadata_agent.ini.tpl b/neutron/templates/etc/_metadata_agent.ini.tpl
index 02fb932e8a..813242f477 100644
--- a/neutron/templates/etc/_metadata_agent.ini.tpl
+++ b/neutron/templates/etc/_metadata_agent.ini.tpl
@@ -293,7 +293,8 @@
 # argument to be passed to the dogpile.cache backend. Example format:
 # "<argname>:<value>". (multi valued)
 # from .cache.oslo.cache.backend_argument (multiopt)
-{{ if not .cache.oslo.cache.backend_argument }}#backend_argument = {{ .cache.oslo.cache.backend_argument | default "" }}{{ else }}{{ range .cache.oslo.cache.backend_argument }}backend_argument = {{ . }}{{ end }}{{ end }}
+{{ if not .cache.oslo.cache.backend_argument }}#backend_argument = {{ .cache.oslo.cache.backend_argument | default "" }}{{ else }}{{ range .cache.oslo.cache.backend_argument }}backend_argument = {{ . }}
+{{ end }}{{ end }}
 
 # Proxy classes to import that will affect the way the dogpile.cache backend
 # functions. See the dogpile.cache documentation on changing-backend-behavior.
diff --git a/neutron/templates/etc/_neutron.conf.tpl b/neutron/templates/etc/_neutron.conf.tpl
index 634156b7af..c984585171 100644
--- a/neutron/templates/etc/_neutron.conf.tpl
+++ b/neutron/templates/etc/_neutron.conf.tpl
@@ -1642,7 +1642,8 @@
 # messaging, messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -2121,7 +2122,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [qos]
diff --git a/nova/templates/etc/_nova.conf.tpl b/nova/templates/etc/_nova.conf.tpl
index 58a2dc90fd..a3ee5ff785 100644
--- a/nova/templates/etc/_nova.conf.tpl
+++ b/nova/templates/etc/_nova.conf.tpl
@@ -717,7 +717,8 @@
 # Reason: stevedore and setuptools entry points now allow a set of plugins to be
 # specified without this config option.
 # from .default.nova.conf.compute_available_monitors (multiopt)
-{{ if not .default.nova.conf.compute_available_monitors }}#compute_available_monitors = {{ .default.nova.conf.compute_available_monitors | default "" }}{{ else }}{{ range .default.nova.conf.compute_available_monitors }}compute_available_monitors = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.compute_available_monitors }}#compute_available_monitors = {{ .default.nova.conf.compute_available_monitors | default "" }}{{ else }}{{ range .default.nova.conf.compute_available_monitors }}compute_available_monitors = {{ . }}
+{{ end }}{{ end }}
 
 #
 # A list of monitors that can be used for getting compute metrics.
@@ -1655,7 +1656,8 @@
 #     configuration file.
 #  (multi valued)
 # from .default.nova.conf.dhcpbridge_flagfile (multiopt)
-{{ if not .default.nova.conf.dhcpbridge_flagfile }}#dhcpbridge_flagfile = {{ .default.nova.conf.dhcpbridge_flagfile | default "/etc/nova/nova-dhcpbridge.conf" }}{{ else }}{{ range .default.nova.conf.dhcpbridge_flagfile }}dhcpbridge_flagfile = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.dhcpbridge_flagfile }}#dhcpbridge_flagfile = {{ .default.nova.conf.dhcpbridge_flagfile | default "/etc/nova/nova-dhcpbridge.conf" }}{{ else }}{{ range .default.nova.conf.dhcpbridge_flagfile }}dhcpbridge_flagfile = {{ . }}
+{{ end }}{{ end }}
 
 #
 # The location where the network configuration files will be kept. The default
@@ -1736,7 +1738,8 @@
 #     use_network_dns_servers
 #  (multi valued)
 # from .default.nova.conf.dns_server (multiopt)
-{{ if not .default.nova.conf.dns_server }}#dns_server = {{ .default.nova.conf.dns_server | default "" }}{{ else }}{{ range .default.nova.conf.dns_server }}dns_server = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.dns_server }}#dns_server = {{ .default.nova.conf.dns_server | default "" }}{{ else }}{{ range .default.nova.conf.dns_server }}dns_server = {{ . }}
+{{ end }}{{ end }}
 
 #
 # When this option is set to True, the dns1 and dns2 servers for the network
@@ -1776,7 +1779,8 @@
 #     routing_source_ip
 #  (multi valued)
 # from .default.nova.conf.force_snat_range (multiopt)
-{{ if not .default.nova.conf.force_snat_range }}#force_snat_range = {{ .default.nova.conf.force_snat_range | default "" }}{{ else }}{{ range .default.nova.conf.force_snat_range }}force_snat_range = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.force_snat_range }}#force_snat_range = {{ .default.nova.conf.force_snat_range | default "" }}{{ else }}{{ range .default.nova.conf.force_snat_range }}force_snat_range = {{ . }}
+{{ end }}{{ end }}
 
 #
 # The path to the custom dnsmasq configuration file, if any.
@@ -1860,7 +1864,8 @@
 #     A list of zero or more interface names, or the word 'all'.
 #  (multi valued)
 # from .default.nova.conf.forward_bridge_interface (multiopt)
-{{ if not .default.nova.conf.forward_bridge_interface }}#forward_bridge_interface = {{ .default.nova.conf.forward_bridge_interface | default "all" }}{{ else }}{{ range .default.nova.conf.forward_bridge_interface }}forward_bridge_interface = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.forward_bridge_interface }}#forward_bridge_interface = {{ .default.nova.conf.forward_bridge_interface | default "all" }}{{ else }}{{ range .default.nova.conf.forward_bridge_interface }}forward_bridge_interface = {{ . }}
+{{ end }}{{ end }}
 
 #
 # This option determines the IP address for the network metadata API server.
@@ -2413,7 +2418,8 @@
 
 # DNS Servers for LDAP DNS driver (multi valued)
 # from .default.nova.conf.ldap_dns_servers (multiopt)
-{{ if not .default.nova.conf.ldap_dns_servers }}#ldap_dns_servers = {{ .default.nova.conf.ldap_dns_servers | default "dns.example.org" }}{{ else }}{{ range .default.nova.conf.ldap_dns_servers }}ldap_dns_servers = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.ldap_dns_servers }}#ldap_dns_servers = {{ .default.nova.conf.ldap_dns_servers | default "dns.example.org" }}{{ else }}{{ range .default.nova.conf.ldap_dns_servers }}ldap_dns_servers = {{ . }}
+{{ end }}{{ end }}
 
 # Base DN for DNS entries in LDAP (string value)
 # from .default.nova.conf.ldap_dns_base_dn
@@ -2609,7 +2615,8 @@
 #     "type-PF" and "type-VF".
 #  (multi valued)
 # from .default.nova.conf.pci_alias (multiopt)
-{{ if not .default.nova.conf.pci_alias }}#pci_alias = {{ .default.nova.conf.pci_alias | default "" }}{{ else }}{{ range .default.nova.conf.pci_alias }}pci_alias = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.pci_alias }}#pci_alias = {{ .default.nova.conf.pci_alias | default "" }}{{ else }}{{ range .default.nova.conf.pci_alias }}pci_alias = {{ . }}
+{{ end }}{{ end }}
 
 #
 # White list of PCI devices available to VMs.
@@ -2665,7 +2672,8 @@
 #                                  {"product_id":"0002", "vendor_id":"8086"}]
 #  (multi valued)
 # from .default.nova.conf.pci_passthrough_whitelist (multiopt)
-{{ if not .default.nova.conf.pci_passthrough_whitelist }}#pci_passthrough_whitelist = {{ .default.nova.conf.pci_passthrough_whitelist | default "" }}{{ else }}{{ range .default.nova.conf.pci_passthrough_whitelist }}pci_passthrough_whitelist = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.pci_passthrough_whitelist }}#pci_passthrough_whitelist = {{ .default.nova.conf.pci_passthrough_whitelist | default "" }}{{ else }}{{ range .default.nova.conf.pci_passthrough_whitelist }}pci_passthrough_whitelist = {{ . }}
+{{ end }}{{ end }}
 
 #
 # The number of instances allowed per project.
@@ -3068,7 +3076,8 @@
 #     scheduler_default_filters
 #  (multi valued)
 # from .default.nova.conf.scheduler_available_filters (multiopt)
-{{ if not .default.nova.conf.scheduler_available_filters }}#scheduler_available_filters = {{ .default.nova.conf.scheduler_available_filters | default "nova.scheduler.filters.all_filters" }}{{ else }}{{ range .default.nova.conf.scheduler_available_filters }}scheduler_available_filters = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.scheduler_available_filters }}#scheduler_available_filters = {{ .default.nova.conf.scheduler_available_filters | default "nova.scheduler.filters.all_filters" }}{{ else }}{{ range .default.nova.conf.scheduler_available_filters }}scheduler_available_filters = {{ . }}
+{{ end }}{{ end }}
 
 #
 # This option is the list of filter class names that will be used for filtering
@@ -3760,7 +3769,8 @@
 # <os_type>=<mkfs command>
 #  (multi valued)
 # from .default.nova.conf.virt_mkfs (multiopt)
-{{ if not .default.nova.conf.virt_mkfs }}#virt_mkfs = {{ .default.nova.conf.virt_mkfs | default "" }}{{ else }}{{ range .default.nova.conf.virt_mkfs }}virt_mkfs = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.virt_mkfs }}#virt_mkfs = {{ .default.nova.conf.virt_mkfs | default "" }}{{ else }}{{ range .default.nova.conf.virt_mkfs }}virt_mkfs = {{ . }}
+{{ end }}{{ end }}
 
 #
 # If enabled, attempt to resize the filesystem by accessing the image over a
@@ -3843,7 +3853,8 @@
 #   and on NUMA node 1 1 page of 1GiB.
 #  (dict value)
 # from .default.nova.conf.reserved_huge_pages (multiopt)
-{{ if not .default.nova.conf.reserved_huge_pages }}#reserved_huge_pages = {{ .default.nova.conf.reserved_huge_pages | default "<None>" }}{{ else }}{{ range .default.nova.conf.reserved_huge_pages }}reserved_huge_pages = {{ . }}{{ end }}{{ end }}
+{{ if not .default.nova.conf.reserved_huge_pages }}#reserved_huge_pages = {{ .default.nova.conf.reserved_huge_pages | default "<None>" }}{{ else }}{{ range .default.nova.conf.reserved_huge_pages }}reserved_huge_pages = {{ . }}
+{{ end }}{{ end }}
 
 #
 # From oslo.log
@@ -4318,7 +4329,8 @@
 # argument to be passed to the dogpile.cache backend. Example format:
 # "<argname>:<value>". (multi valued)
 # from .cache.nova.conf.backend_argument (multiopt)
-{{ if not .cache.nova.conf.backend_argument }}#backend_argument = {{ .cache.nova.conf.backend_argument | default "" }}{{ else }}{{ range .cache.nova.conf.backend_argument }}backend_argument = {{ . }}{{ end }}{{ end }}
+{{ if not .cache.nova.conf.backend_argument }}#backend_argument = {{ .cache.nova.conf.backend_argument | default "" }}{{ else }}{{ range .cache.nova.conf.backend_argument }}backend_argument = {{ . }}
+{{ end }}{{ end }}
 
 # Proxy classes to import that will affect the way the dogpile.cache backend
 # functions. See the dogpile.cache documentation on changing-backend-behavior.
@@ -7774,7 +7786,8 @@
 # messagingv2, routing, log, test, noop (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set,
 # we fall back to the same configuration used for RPC. (string value)
@@ -8264,7 +8277,8 @@
 # valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [placement]
diff --git a/senlin/templates/etc/_senlin.conf.tpl b/senlin/templates/etc/_senlin.conf.tpl
index 99449957ea..ad20d4f1f9 100644
--- a/senlin/templates/etc/_senlin.conf.tpl
+++ b/senlin/templates/etc/_senlin.conf.tpl
@@ -1004,7 +1004,8 @@
 # (multi valued)
 # Deprecated group/name - [DEFAULT]/notification_driver
 # from .oslo_messaging_notifications.oslo.messaging.driver (multiopt)
-{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_messaging_notifications.oslo.messaging.driver }}#driver = {{ .oslo_messaging_notifications.oslo.messaging.driver | default "" }}{{ else }}{{ range .oslo_messaging_notifications.oslo.messaging.driver }}driver = {{ . }}
+{{ end }}{{ end }}
 
 # A URL representing the messaging driver to use for notifications. If not set, we fall back to the same configuration
 # used for RPC. (string value)
@@ -1435,7 +1436,8 @@
 # to be searched.  Missing or empty directories are ignored. (multi valued)
 # Deprecated group/name - [DEFAULT]/policy_dirs
 # from .oslo_policy.oslo.policy.policy_dirs (multiopt)
-{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}{{ end }}{{ end }}
+{{ if not .oslo_policy.oslo.policy.policy_dirs }}#policy_dirs = {{ .oslo_policy.oslo.policy.policy_dirs | default "policy.d" }}{{ else }}{{ range .oslo_policy.oslo.policy.policy_dirs }}policy_dirs = {{ . }}
+{{ end }}{{ end }}
 
 
 [revision]
diff --git a/tools/gen-oslo-openstack-helm/generate.py b/tools/gen-oslo-openstack-helm/generate.py
index 08dabecaf5..4e62f87dd9 100755
--- a/tools/gen-oslo-openstack-helm/generate.py
+++ b/tools/gen-oslo-openstack-helm/generate.py
@@ -525,7 +525,7 @@ class _HelmOptFormatter(object):
                                     namespace, opt.dest))
                 lines.append('{{ if not .%s.%s.%s }}#%s = '
                              '{{ .%s.%s.%s | default "%s" }}{{ else }}'
-                             '{{ range .%s.%s.%s }}%s = {{ . }}{{ end }}'
+                             '{{ range .%s.%s.%s }}%s = {{ . }}\n{{ end }}'
                              '{{ end }}\n' % (
                                     group_name.lower(),
                                     namespace,