forked from bfraser/puppet-grafana
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
address
param from grafana_organization
Organization Info (ie. its address) was removed from the Grafana UI in grafana/grafana@21a7f57 According to https://grafana.com/docs/grafana/v8.4/http_api/org/#update-organization the API was not fully implemented, so I'm unconvinced this ever worked. The property `id` is also removed as it's internal to grafana and not something you could ever update. Updating a `grafana_organization` never worked as `save_organization` only implemented POSTs, (and would actually explode if you tried to update `address`)
- Loading branch information
1 parent
e2fccf8
commit 0d2a1e8
Showing
5 changed files
with
99 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
supported_versions.each do |grafana_version| | ||
describe "grafana_organization with Grafana version #{grafana_version}" do | ||
prepare_host | ||
context 'setup grafana server' do | ||
it 'runs successfully' do | ||
pp = <<-EOS | ||
class { 'grafana': | ||
version => "#{grafana_version}", | ||
cfg => { | ||
security => { | ||
admin_user => 'admin', | ||
admin_password => 'admin' | ||
} | ||
} | ||
} | ||
EOS | ||
prepare_host | ||
|
||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
end | ||
|
||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
grafana_organization { 'org1': | ||
grafana_url => 'http://localhost:3000', | ||
grafana_user => 'admin', | ||
grafana_password => 'admin', | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe 'Organizations with specials characters in name' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
grafana_organization { 'Example Org!': | ||
grafana_url => 'http://localhost:3000', | ||
grafana_user => 'admin', | ||
grafana_password => 'admin', | ||
} | ||
PUPPET | ||
end | ||
end | ||
end | ||
|
||
describe 'Deleting organizations' do | ||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
grafana_organization { ['org1','Example Org!']: | ||
ensure => absent, | ||
grafana_url => 'http://localhost:3000', | ||
grafana_user => 'admin', | ||
grafana_password => 'admin', | ||
} | ||
PUPPET | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters