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_datasource no longer idempotent #270

Closed
MartyEwings opened this issue Nov 29, 2021 · 5 comments
Closed

Grafana_datasource no longer idempotent #270

MartyEwings opened this issue Nov 29, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@MartyEwings
Copy link

MartyEwings commented Nov 29, 2021

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.12.1
  • Distribution: centos8
  • Module version: 10

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

called from the metrics dashboard module:

  $puppet_metrics_dashboard::influxdb_database_name.each |$db_name| {
    grafana_datasource { "influxdb_${db_name}":
      grafana_url      => "${_uri}://localhost:${puppet_metrics_dashboard::grafana_http_port}",
      type             => 'influxdb',
      database         => $db_name,
      url              => 'http://localhost:8086',
      access_mode      => 'proxy',
      is_default       => false,
      user             => 'admin',
      password         => $puppet_metrics_dashboard::influx_db_password,
      grafana_user     => 'admin',
      grafana_password => $puppet_metrics_dashboard::grafana_password,
      require          => [
        Service['grafana-server'],
        Exec["create influxdb puppet_metrics database ${db_name}"]
      ],
    }

What are you seeing

Since upgrade from 9.0.1 to 10 I'm getting the following when applying a Grafana_datasource resource

/Stage[main]/Puppet_metrics_dashboard::Post_start_configs/Grafana_datasource[influxdb_telegraf]/is_default: is_default changed false to 'false' (corrective)

for some reason we are getting a corrective change from a boolean value to a string, despite boolean being the only thing passed in code

What behaviour did you expect instead

the boolean value should not be converted to a string

Output log

/Stage[main]/Puppet_metrics_dashboard::Post_start_configs/Grafana_datasource[influxdb_telegraf]/is_default: is_default changed false to 'false' (corrective)

Any additional information you'd like to impart

I can see some changes to the resource carried out by rubocop, changing values for is_default from :false to false i don't know if that's the reason

@alexjfisher
Copy link
Member

@MartyEwings Thanks for the bug report. You're right in suspecting the recent rubocop autofix commit. Unfortunately the rubocop:autocorrect rake task performs unsafe corrections, and in this case using a symbol instead of a boolean was definitely intended and shouldn't have been changed.
I've proposed voxpupuli/voxpupuli-test#66 and then it shouldn't be difficult for us to revert the breaking parts of 70c2adc

@MartyEwings
Copy link
Author

@alexjfisher thanks for the quick turn around on that one! i don't have to compensate in the metrics dashboard now!

@alexjfisher
Copy link
Member

Not quite there yet. voxpupuli-test 5.1.1 gem was released a few minutes ago.
voxpupuli/voxpupuli-test#67

Still got to revert the bad rubocop change and release a 10.0.1 of this module.

@root-expert
Copy link
Member

Fixed in 771a032 (closing for Changelog)

@alexjfisher
Copy link
Member

@MartyEwings 10.0.1 is now released and should fix your issue. Enjoy!

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
Development

No branches or pull requests

3 participants