Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana 5.0.3 Users passwords being set and datasources created on every puppet run #104

Closed
iaa-inc opened this issue Mar 18, 2018 · 2 comments · Fixed by #211
Closed

Grafana 5.0.3 Users passwords being set and datasources created on every puppet run #104

iaa-inc opened this issue Mar 18, 2018 · 2 comments · Fixed by #211
Labels
bug Something isn't working

Comments

@iaa-inc
Copy link

iaa-inc commented Mar 18, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.1
  • Ruby: 2.3.1
  • Distribution:
  • Module version: 4.2.0
  • Grafana 5.0.3

How to reproduce (e.g Puppet code you use)

Create a datasource or user by any supported method.

What are you seeing

On every puppet agent run, every datasource is re-created and passwords for users are being re-set (instance method is returning an empty string).

What behaviour did you expect instead

Datasources are created once if they don't already exist. Users are created and hashes checked??

Output log

Notice: /Stage[main]/Profile::Grafana/Grafana_user[tardoe]/password: password changed '' to 'p4dummypassword'
Notice: /Stage[main]/Profile::Grafana/Grafana_datasource[Influx]/ensure: created
Notice: /Stage[main]/Profile::Grafana/Grafana_datasource[Influx Public]/ensure: created
Notice: Applied catalog in 7.67 seconds

Any additional information you'd like to impart

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Mar 22, 2018
@aptituz
Copy link

aptituz commented Sep 27, 2018

I can't confirm the bug with the datasources, but I can confirm that behavior for users.

Given that the API doesn't support to "get" the password for a user and the fact that providers in puppet need to know the value to compare it, I think there is no "proper" solution to fix this problem.

A possible option would be to set passwords only for new users and ignore the password attribute when updating existing users. This would require to sacrifice the ability to change passwords via puppet, but maybe that's the better option instead of changing it on every puppet run and therefore issuing useless API requests.

@joernott
Copy link

joernott commented Dec 2, 2019

A simple solution to check a password is using it, e.g. an api call to log in. I have used this kind of behaviour a couple of times. With a successful login, you can validate if the password is set correctly.

alexjfisher added a commit to alexjfisher/puppet-grafana that referenced this issue Apr 21, 2020
alexjfisher pushed a commit to alexjfisher/puppet-grafana that referenced this issue Apr 21, 2020
alexjfisher pushed a commit to alexjfisher/puppet-grafana that referenced this issue Apr 21, 2020
This commit fixes the issue that on each puppet run the user password
will be set.  As the grafana API does not provide any feature for that
we try to connect as that user if login works we suppress the password
change.

Fixes voxpupuli#104
unki pushed a commit to unki/puppet-grafana that referenced this issue Sep 28, 2020
This commit fixes the issue that on each puppet run the user password
will be set.  As the grafana API does not provide any feature for that
we try to connect as that user if login works we suppress the password
change.

Fixes voxpupuli#104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants