-
Notifications
You must be signed in to change notification settings - Fork 40
Use a healthcheck as recommended by the puppet-grafana docs #26
Conversation
51b7124
to
8236a6c
Compare
8236a6c
to
a572d75
Compare
a572d75
to
27b819e
Compare
Should have done this earlier, my mistake. Tests should pass now:
|
27b819e
to
2bceb50
Compare
Annnd now it seems that the node declaration in
|
2bceb50
to
5f1873b
Compare
Testing: Fresh CentOS 7, all defaults
Fresh CentOS 7, custom password, add dashboards
I logged into the web interface to verify the pw and the dashboards |
8148113
to
42ab534
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some testing just now and ran into a few issues.
|
||
exec { 'update Grafana admin password': | ||
path => '/usr/bin', | ||
command => @("CHANGE_GRAFANA_PW"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still seeing issues with this on the initial run
Error: /Stage[main]/Puppet_metrics_dashboard::Grafana/Exec[update Grafana admin password]: Failed to call refresh: 'curl -X PUT -H "Content-Type: application/json" -d '{
"oldPassword": "admin",
"newPassword": "admin",
"confirmNew": "admin"
}' http://admin:admin@localhost:8080/api/user/password
' returned 7 instead of one of [0]
and attempting to change the password:
Error: /Stage[main]/Puppet_metrics_dashboard::Post_start_configs/Grafana_datasource[influxdb_telegraf]: Could not evaluate: Fail to retrieve datasources (HTTP response: 401/{"message":"Invalid username or password"})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's your test methodology here? I ask cause, as shown in the output above, a single pass works fine on CentOS 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a vmpooler host (Debian 9) running against a 2018.1.5 master. I did notice that the compiled catalog looks a little odd wrt the exec resource in the puppet_metrics_dashboard::grafana
class:
"parameters": {
"command": "curl -X PUT -H \"Content-Type: application/json\" -d '{\n \"oldPassword\": \"admin\",\n \"newPassword\": \"password\",\n \"confirmNew\": \"password\"\n}' http://admin:admin@localhost:3000/api/user/password\n",
"cwd": "/usr/share/grafana",
"path": "/usr/bin",
"refreshonly": true
},
Maybe the line breaks are the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be but at least now I've got an idea on what to look at.
c535d39
to
55a5521
Compare
@suckatrash Sorry for the hiatus! I have just rebased this on current master. Will you see if you are still having problems? If the admin stuff is still messing up it might be better to abandon that aspect of this and just use the task that I got added to the Grafana module via voxpupuli/puppet-grafana#148 |
Just tested this and I think in the agent run Cool that you got a task added! Want to just go with the healthcheck changes since that's a nice improvement? Or maybe some added ordering could solve the problem above? |
55a5521
to
6c08dfa
Compare
Running some tests now to see if some simple ordering will help |
bd1c2ff
to
9610367
Compare
@suckatrash try this one please |
@genebean I'm getting the same error as before :(
|
Can we pair on this @suckatrash as there seems to be a serious disconnect between our two testing methods? |
Implement setting the admin password - Setting occurs during installation or update. - This fixes puppetlabs#24 Use a healthcheck as recommended by the docs - This implements some additional ordering of resources so that ones that require the API are not run before the API is up. Also added 'descr' to yum repo to make the yum command happy
9610367
to
6d0c4b9
Compare
@genebean - this looks good now. I think the only thing we're missing is a Readme update to reflect how password change works. i.e. - the password will be set during the initial install, otherwise, you'll have to trigger a refresh with the addition of some other config change (setting / unsetting ssl would work, as would changing grafana's port) |
Given that, should we pull the password stuff back out and just let people change it post-install using one of the fully supported methods? |
I just found out that in Grafana 6 you'll be prompted to change the password from the default when you log in for the first time. That means that a user might go with a default configuration, log in, change the password and then end up with failing puppet runs until they update the With that in mind I think we might need a password change mechanism built in. |
You should be able to avoid that by setting these environment variables:
This post has some more info on configuring Dockerized Grafana: https://riamf.github.io/posts/dockerized_grafana_setup/ |
@genebean is this something still relevant or has everything moved on too much |
This would be a welcome addition but this PR is stale with no updates for over 2 years. I am closing this PR, but please reopen it with changes or open a new one with this feature. |
This builds on #25. It implements some additional ordering of resources so that ones that require the API are not run before the API is up.