Hi Checkmk Community,
We are building an automated deployment pipeline (via Ansible) for Checkmk 2.4.0 (2.4.0p35.cre). As part of our automated site provisioning process, we need to set or update the cmkadmin user password during deployment without manual intervention.
Because this is running in an automated pipeline, we cannot interactively log in or type passwords into interactive prompts.
Approaches We Have Tried & Issues Encountered:
-
cmk-passwd cmkadminvia stdio / piping (printf ... | cmk-passwd)- Result: Fails because
cmk-passwduses Python’sgetpassmodule, which expects an interactive TTY and ignoresstdininput.
- Result: Fails because
-
Standard
htpasswdbinary (htpasswd -b /omd/sites/<site>/etc/htpasswd cmkadmin <pass>)- Result: Updates the
htpasswdfile, but Checkmk 2.4 does not accept the new credentials upon Web UI login. Checkmk 2.4 caches authentication state in/var/check_mk/web/cmkadmin/(cached_profile.mk,last_pw_change.mk, etc.), causing logins to fail or become locked out (num_failed_logins.mk).
- Result: Updates the
-
REST API Endpoint (
/check_mk/api/1.0/objects/user_config/cmkadmin)- Result: On freshly deployed poller sites, the default automation credentials or secrets are either not initialized or unavailable, making API authentication impossible prior to initial configuration.
-
Direct Python module invocation (
cmk.cmkpasswd)- Result: Invoking
_run_cmkpasswdvia python script updates/etc/htpasswd, but the session cache state in Checkmk 2.4 remains out of sync unless manual cache purging and site restarts occur.
- Result: Invoking
Questions for the Developers / Community:
-
Is there an official, supported CLI command or flag in Checkmk 2.4 to change a user password non-interactively? (e.g., passing the password via an environment variable, parameter, or config file).
-
What is the recommended best practice for bootstrapping
cmkadmincredentials during automated CI/CD / Ansible provisioning? -
Which specific user session/cache files need to be updated or cleared alongside
/etc/htpasswdto ensure Checkmk 2.4 recognizes password changes without requiring a GUI login first?
Any guidance or recommended CLI workaround for pipeline deployment would be greatly appreciated!