grafana icon indicating copy to clipboard operation
grafana copied to clipboard

`grafana_config_security` property `admin_user` is not set in grafana.ini and `admin_password` is not set

Open HP41 opened this issue 1 year ago • 2 comments

:ghost: Brief Description

  • grafana_config_security property admin_user is not set in grafana.ini.
  • Additionally, admin_password is not set even if it is rendered out in grafana.ini.

:pancakes: Cookbook version

Latest as of writing this: 10.2.0

:woman_cook: Chef-Infra Version

cinc-client --version
Cinc Client: 16.18.0

:tophat: Platform details

Standard Ubuntu 20.04 in test kitchen

Steps To Reproduce

# Resource declaration
grafana_config_security 'grafana' do
  admin_user 'test_admin'
  admin_password 'test_password'
  secret_key 'abcdefghijklmno'
  cookie_secure true
  cookie_samesite 'lax'
end
; In test kitchen /etc/grafana/grafana.ini
[security]
admin_password = changeme
cookie_samesite = lax
cookie_secure = true
secret_key = abcdefghijklmno

:police_car: Expected behavior

  • /etc/grafana/grafana.ini should have line: admin_user = test_admin
  • When logging into grafana, should be able to login with test_admin:test_password

:heavy_plus_sign: Additional context

  • admin_user
    • Unsure where it could be getting omitted. For some reason it does not show up at all.
  • admin_password:
    • According to official docs, this is only set once (probably at first service start)
    • And the service does start when apt install.
    • Unsure how this can be fixed. Perhaps an apt option to not start the service
    • Or use grafana-cli admin reset-admin-password command conditionally (https://grafana.com/docs/grafana/v9.3/cli/#reset-admin-password)

HP41 avatar Dec 05 '22 23:12 HP41

@bmhughes , I was wondering if you've any thoughts on this? Thank you!

HP41 avatar Feb 07 '23 19:02 HP41

@HP41 this seems to work on the latest version of the cookbook. Can you please confirm this is still broken for you?

ramereth avatar Mar 10 '24 19:03 ramereth