Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Ensure initial admin password is set on first run #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szymonpk
Copy link

@szymonpk szymonpk commented Nov 2, 2017

This change applies only to the debian-based family.

After package install, grafana-server service is automatically started.
In result, default "admin" password is assigned to "admin" user.

Reference: http://docs.grafana.org/installation/configuration/#admin-password

To setup initial password it is required to write it in grafana.ini
before first service start. Currently, the only way to achieve this, is
to block service autostart (dpkg_autostart resource) and let Chef
handle everything - enable service and restart after grafana.ini is
changed.

This change should not be disruptive for any cookbook user.

This change applies only to the debian-based family.

After package install, grafana-server service is automatically started.
In result, default "admin" password is assigned to "admin" user.

Reference: http://docs.grafana.org/installation/configuration/#admin-password

To setup initial password it is required to write it in grafana.ini
before first service start. Currently, the only way to achieve this, is
to block service autostart (dpkg_autostart resource) and let Chef
handle everything - enable service and restart after grafana.ini is
changed.

This change should not be disruptive for any cookbook user.

Signed-off-by: Szymon Szypulski <[email protected]>
@szymonpk szymonpk force-pushed the set-initial-admin-password branch from 3e72d47 to 1d92163 Compare November 2, 2017 12:41
@@ -32,5 +36,5 @@
end

service 'grafana-server' do
action [:enable, :start]
action :enable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks like the service isn't started so would impact folks. Can you give more information about why the change here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With :start service was started before configuration recipe kicked-in. And admin-password was set to the default one. It should not be a problem because change to grafana.ini will induce restart..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants