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

Implement plugin versions #263

Closed
wants to merge 56 commits into from
Closed

Implement plugin versions #263

wants to merge 56 commits into from

Conversation

TuningYourCode
Copy link

Pull Request (PR) description

This PR provides a package provider to manage grafana plugins as the current grafana_plugin resource does not offer all functions like installation of specific plugin versions or keeping plugins up to date with ensure => latest.

This functionality is now given by using

package { 'grafana-image-renderer':
  ensure => 'latest',
  provider => 'grafana',
}

or

package { 'grafana-image-renderer':
  ensure => '2.0.0',
  provider => 'grafana',
}

This Pull Request (PR) fixes the following issues

Fixes #178

@root-expert root-expert added enhancement New feature or request needs-tests labels Oct 13, 2021
@root-expert
Copy link
Member

Seems like we are having a failing master here...

@root-expert
Copy link
Member

Is this supposed to be a replacement for grafana_plugin ? If yes, maybe we should add a deprecation notice in the docs for user to gradually switch to the new package provider?

BTW master should be fixed now if you want to rebase @TuningYourCode 😄

Comment on lines 177 to 202

context 'grafana plugins' do
it 'installs' do
pp = <<-EOS
class { 'grafana':
version => 'latest',
}

package { 'grafana-image-renderer':
provider => 'grafana',
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe package('grafana-image-renderer') do
it { is_expected.to be_installed }
end

describe service('grafana-server') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could move this to grafana_plugin_spec.rb?

@bastelfreak
Copy link
Member

@TuningYourCode can you please rebase against master to get rid of the merge commits and run bundle exec rake rubocop:auto_correct? That should fix the rubocop complaints.

@vox-pupuli-tasks
Copy link

Dear @TuningYourCode, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@SimonHoenscheid
Copy link
Member

@TuningYourCode Can you please rebase and fix the conflicts?

alexjfisher and others added 14 commits June 28, 2023 13:40
Useful when your configuration contains passwords you don't want to
expose in your puppet logs and reports.
This hasn't been the case since Puppet 3.
Similar to 04fcd91 this commit adds
support for `Sensitive` to the `ldap_cfg` parameter.

I've also fixed the LDAP examples `email` attibute to be `mail` which
is correct for Active Directory (where `username` is `sAMAccountName`)
Previously `save_user` was being called once per changed property and
calls were also being made to update user properties, password and the
admin flag regardless of whether these properties needed updating.

Using `flush` is more efficient.

* `full_name` is fixed (it was previously a parameter instead of a property).
* When a user is created, `is_admin` is correctly set in a single Puppet run.
* Properties can be managed individually.
* Instead of making `password` mandatory, (when creating a user), if
  `password` isn't specified, a random one is used.

Fixes #121
Previously, the number of API calls to look up the details of a single
user was equal to `1 + the number of existing users`.  This made
managing multiple users exponentially slow.

The way the types in this module are written, (with the Grafana API
user credentials being parameters of each resource), we can't implement
`prefetch` to fetch all users just once; but we can change the
implementation to directly lookup the user we're trying to manage.
This is _much_ faster!
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`)
This disables testing on Arch Linux. The acceptance tests never worked.
The goal is to merge this PR, rebase the modulesync PR and merge it,
afterwards create a new PR which readds Arch Linux and fixes the tests.
smortex and others added 28 commits June 28, 2023 13:40
According to https://packages.grafana.com/:
> The GPG key used to sign the APT repository (fingerprint
> 4E40DDF6D76E284A4A6780E48C8C34C524098CB6) was rotated on 2023-01-12 and
> replaced with a new key with fingerprint
> 0E22EB88E39E12277A7760AE9E439B102CF3C0C6.

Update the key accordingly.
This allow puppet-strings to catch default values in documentation.

While here, fix the documentation for puppet-strings.
fixes #278
refs #151

Signed-off-by: Adrian Nöthlich <[email protected]>
These packages are currently not available.
The last 7.x release was ~6 month ago and basically correspond to the
beginning of availability of version 9.x.  7.x not being updated
anymore, we can drop it (and older versions) with the benefit of
speeding-up the acceptance test suite.

While here, bump the version of the older releases which are older than
the operating systems we support and where sometimes not compatible.  Do
not do this for 9.x because we also test with 'latest'.
@TuningYourCode TuningYourCode closed this by deleting the head repository Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request merge-conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: version support in plugin module
9 participants