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 not created under the correct organization #96

Open
ikkaro opened this issue Feb 26, 2018 · 1 comment
Open

grafana_datasource not created under the correct organization #96

ikkaro opened this issue Feb 26, 2018 · 1 comment

Comments

@ikkaro
Copy link

ikkaro commented Feb 26, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.4.0
  • Ruby: ruby 2.4.3p205
  • Distribution: Ubuntu 16.04
  • Module version: puppet-grafana (v4.1.2-rc0)

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

This is to make sure the organizations are created before creating the new datasource.
I want to create a new datasource in PRUEBA1 organization.

curl -s http://admin:XXXXXX@localhost:8080/api/orgs | jq
[
  {
    "id": 1,
    "name": "Main Org."
  },
  {
    "id": 2,
    "name": "PRUEBA1"
  },
  {
    "id": 3,
    "name": "PRUEBA2"
  }
]

Also note that documentation is not clear, it says org_name but the real parameter is organization.

  grafana_datasource { 
'influxdb':
  grafana_url       => 'http://127.0.0.1:8080',
  grafana_user      => 'admin',
  grafana_password  => 'XXXXX',
  type              => 'influxdb',
  organization      => 'PRUEBA1',
  url               => 'http://localhost:8086',
  user              => 'admin',
  password          => '1nFlux5ecret',
  database          => 'graphite',
  access_mode       => 'proxy',
  is_default        => true,

What are you seeing

The datasource is created in the incorrect organization.

[
  {
    "id": 3,
    **"orgId": 1,**
    "name": "influxdb",
    "type": "influxdb",
    "typeLogoUrl": "public/app/plugins/datasource/influxdb/img/influxdb_logo.svg",
    "access": "proxy",
    "url": "http://localhost:8086",
    "password": "1nFlux5ecret",
    "user": "admin",
    "database": "graphite",
    "basicAuth": false,
    "isDefault": true,
    "jsonData": {}
  }
]

What behaviour did you expect instead

The datasource orgId should be 2 (PRUEBA1)

Output log

Notice: /Stage[main]/Profiles::Grafana_ds/Grafana_datasource[influxdb]/ensure: created

Any additional information you'd like to impart

@brandonrdn
Copy link

@bastelfreak This should be fixed now with the latest update. @ikkaro Can you check in your environment and let us know if the latest push resolves this issue for you?

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

No branches or pull requests

2 participants