Skip to content

Add kibana_system_password and elasticsearch_keystore_entries#104

Open
Oddly wants to merge 2 commits intomainfrom
feat/custom-passwords-and-keystore-entries
Open

Add kibana_system_password and elasticsearch_keystore_entries#104
Oddly wants to merge 2 commits intomainfrom
feat/custom-passwords-and-keystore-entries

Conversation

@Oddly
Copy link
Owner

@Oddly Oddly commented Mar 13, 2026

Implements two new user-facing variables for managing secrets in the Elastic Stack.

kibana_system_password (closes #102) lets you set a known password for the kibana_system Elasticsearch user. When set, the role changes it via the /_security/user/kibana_system/_password API on each run and uses that value for Kibana's ES connection. When empty, the auto-generated password from initial setup is used as before.

elasticsearch_keystore_entries (closes #103) is a dict of custom secrets to add to the Elasticsearch keystore — Watcher credentials, LDAP bind passwords, plugin secrets, etc. Values are passed via stdin so they never appear in process listings. The role validates that none of the keys overlap with the eight internally-managed keystore entries (bootstrap password, SSL passwords). If there's a conflict, the playbook fails with an error listing every reserved key and telling you to use the dedicated variable instead. Entries are only written when their value has actually changed, so ES isn't restarted unnecessarily.

Oddly added 2 commits March 13, 2026 09:56
When set, the kibana role changes the kibana_system user's password via
the Elasticsearch security API and uses that value for the connection to
Elasticsearch. When empty (default), behavior is unchanged — the auto-
generated password from initial_passwords is used.

The password change runs once on the CA host, authenticates as the elastic
superuser, and updates the kibana_password fact so the template and keystore
tasks pick up the new value transparently.

Closes #102
Adds a dict variable that lets users put arbitrary secrets into the
Elasticsearch keystore without writing custom tasks. Each entry is set
with elasticsearch-keystore add -f -x, values passed via stdin.

The role validates that none of the user-provided keys overlap with the
eight keys managed internally (bootstrap.password, SSL keystore/truststore
passwords, PEM key passphrases, autoconfiguration hash). If there is a
conflict, the playbook fails immediately with an error listing all reserved
keys and explaining why they cannot be set through this variable.

On each run the role reads current values and only writes changed entries,
so Elasticsearch is not restarted unnecessarily.

Closes #103
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.

Add elasticsearch_keystore_entries for custom keystore management Add kibana_system_password variable (like elasticsearch_elastic_password)

1 participant