Skip to content

Fix external CA first-install config and remove cert restart#86

Merged
Oddly merged 2 commits intomainfrom
fix/external-ca-and-cert-restart
Mar 9, 2026
Merged

Fix external CA first-install config and remove cert restart#86
Oddly merged 2 commits intomainfrom
fix/external-ca-and-cert-restart

Conversation

@Oddly
Copy link
Owner

@Oddly Oddly commented Mar 9, 2026

On first install with elasticsearch_cert_source: external, the template rendered elasticsearch.yml without certificate_authorities because it checked whether ca.crt existed on disk — which it doesn't yet at template render time. The config now checks the input variables (elasticsearch_tls_ca_certificate / *_content) instead, so the CA reference is included from the first run. This fixes inter-node transport TLS failures on fresh external-cert deployments.

Separately, removed the notify: Restart Elasticsearch from all certificate distribution tasks. Elasticsearch auto-reloads SSL contexts when cert files change on disk, so these restarts were unnecessary. The Kibana restart notification is preserved since Node.js requires a process restart to pick up new certs.

Added verify assertions to the elasticsearch_custom_certs scenario: CA presence in both transport and HTTP config sections, verification_mode sanity check, and cert path existence validation.

Closes #78

Oddly added 2 commits March 9, 2026 10:38
…tart on cert changes

The elasticsearch.yml template checked whether ca.crt existed on disk to
decide whether to include certificate_authorities. On first install the CA
file hasn't been deployed yet, so the config rendered without it — breaking
inter-node transport TLS. Now we check the input variables instead of the
file, so the template reflects intent rather than transient state. Closes #78.

Elasticsearch auto-reloads SSL certificates from disk, so the Restart
Elasticsearch handler notifications on every cert copy task were causing
unnecessary restarts. Removed them; the Kibana restart notification is
kept since Node.js does not auto-reload.

Added config assertions to the custom_certs verify to catch this class of
bug: CA presence in both transport and HTTP sections, verification_mode
sanity, and cert path existence.
@Oddly Oddly merged commit d8058dd into main Mar 9, 2026
30 checks passed
@Oddly Oddly deleted the fix/external-ca-and-cert-restart branch March 9, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External CA not included in elasticsearch.yml on first install

1 participant