The ssl.conf Apache mod_ssl configuration template is duplicated
across service operators. Every operator ships the exact
same file. A TLS policy change (cipher suite, protocol version) requires
coordinated patches across all repositories.
Use Go's //go:embed to ship common templates inside lib-common itself.
A new exported function util.GetCommonTemplates() renders the embedded
templates and returns map[filename]renderedContent. Service operators
call it before EnsureSecrets, merging the result into their existing
CustomData map. Operator-specific entries take precedence — if an
operator already defines a file with the same name, the common version
is skipped.
This requires:
- No changes to the
Templatestruct - No changes to
EnsureSecrets/GetTemplateDatapipeline - No changes to the Dockerfile or container build
- No new abstractions (no MergeFS, no overlay filesystem)
Each operator adds ~8 lines of Go code and deletes its local ssl.conf.
| File | Description |
|---|---|
modules/common/util/templates/common/config/ssl.conf |
The common ssl.conf, embedded via //go:embed |
modules/common/util/template_util.go |
Added //go:embed directive, commonTemplates var, and GetCommonTemplates() function — reads embedded FS, renders with Go templates, returns map[string]string |
modules/common/util/template_util_test.go |
Added TestGetCommonTemplates verifying ssl.conf is returned and contains expected directives |
Consumer-side usage (e.g. in generateServiceConfigs):
commonTemplates, err := util.GetCommonTemplates(templateParameters)
if err != nil {
return err
}
for k, v := range commonTemplates {
if _, exists := customData[k]; !exists {
customData[k] = v
}
}| File | Change |
|---|---|
internal/controller/cinder_controller.go |
+10 lines: calls util.GetCommonTemplates(templateParameters) and merges into customData |
templates/cinder/config/ssl.conf |
Deleted (now provided by lib-common) |
All 19 copies are byte-for-byte identical to the lib-common version.
| Operator | Template path(s) | Identical | Drop-in |
|---|---|---|---|
| barbican | barbican/config/ |
YES | YES |
| cinder | cinder/config/ |
YES | Done |
| designate | designateapi/config/ |
YES | YES |
| glance | common/config/ + glanceapi/config/ |
YES (x2) | YES |
| heat | heat/config/ |
YES | YES |
| horizon | horizon/config/ |
YES | YES |
| ironic | ironicapi/config/ + ironicinspector/config/ |
YES (x2) | YES |
| keystone | keystoneapi/config/ |
YES | YES |
| manila | manila/config/ |
YES | YES |
| nova | nova/api/config/ + nova/metadata/config/ |
YES (x2) | YES |
| octavia | octaviaapi/config/ |
YES | YES |
| placement | placementapi/config/ |
YES | YES |
| swift | swiftproxy/config/ |
YES | YES |
| telemetry | autoscaling/config/ + ceilometercentral/config/ + cloudkitty/config/ |
YES (x3) | YES |
| watcher | watcherapi/config/ |
YES | YES |
httpd.conf varies significantly across operators. Only a subset can use
a common template; the rest embed VirtualHost blocks or have substantially
different structures.
| Operator | httpd.conf compatible | Reason if not |
|---|---|---|
| cinder | YES | |
| manila | YES | |
| telemetry (aodh) | YES | |
| telemetry (cloudkitty) | YES | |
| glance (x2) | PARTIAL | Conditional include ({{ if .Wsgi }} wsgi vs proxypass) |
| designate | NO | Inline VirtualHost with WSGI |
| keystone | NO | Inline VirtualHost with WSGI, DocumentRoot, custom includes |
| nova (api + metadata) | NO | Inline VirtualHost with WSGI, Alias blocks |
| placement | NO | Inline VirtualHost with WSGI, Alias blocks |
| octavia (api) | NO | Inline VirtualHost with WSGI, Alias blocks |
| octavia (core) | NO | Full default Apache config (~200 lines) |
| baremetal | NO | Full default Apache config (~200 lines) |
| swift | NO | Inline VirtualHost with ProxyPass |
| ironic | NO | Inline VirtualHost with ProxyPass |
| horizon | NO | Inline VirtualHost with WSGI, custom log vars |
| telemetry (ceilometer) | NO | Inline VirtualHost with ProxyPass |
| barbican | NO | Extra directives (KeepAlive, Timeout), logs to files |
| watcher | NO | Extra directives (KeepAlive, Timeout), different log format |