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

Source option with sensu_gem provider doesn't work #1007

Closed
nagyt234 opened this issue Nov 6, 2018 · 4 comments
Closed

Source option with sensu_gem provider doesn't work #1007

nagyt234 opened this issue Nov 6, 2018 · 4 comments

Comments

@nagyt234
Copy link

nagyt234 commented Nov 6, 2018

Description of problem

  • What did you do?
    I tried to install sensu-plugins-mysql from my forked gihub reposityr with the following command:
ensure_packages($checks_config[$name][sensu_plugin], { provider => sensu_gem, source => 'https://github.com/nagyt234/sensu-plugins-mysql.git', ensure => latest})
  • What happened?
    The plugin was installed from sensu-plugins/sensu-plugins-mysql instead of my repo nagyt234.
  • What did you expect to happen?
    The plugin should be installed from https://github.com/nagyt234/sensu-plugins-mysql.git as stated in sensu-puppet/lib/puppet/provider/package/sensu_gem.rb
  • How can someone reproduce the problem?
    Try the command above.

Command used and debugging output

  • What does your puppet config look like (including any hiera config)
  • Is this a masterless or master based puppet setup?

Platform and version information

  • Your OS: Ubuntu 16.04
  • Your Ruby version: 2.2.2
  • Your version of Puppet: 4.10.4, puppetlabs-stdlib 4.25.1
  • Your version of Sensu: 0.26.5-2
  • Your version of this module: 2.42.0

Anything else to add that you think will be helpful?

@treydock
Copy link
Collaborator

treydock commented Nov 7, 2018

@nagyt234 The source property refers to one from Puppet package provider: https://puppet.com/docs/puppet/5.5/types/package.html#package-attribute-source

The sensu_gem provider inherits most behavior from Puppet's gem provider. The only thing changed by sensu_gem is where to find the actual gem command and how to handle uninstalls. My read of Puppet's gem provider (https://github.com/puppetlabs/puppet/blob/5.5.x/lib/puppet/provider/package/gem.rb#L127) is that source should work the way your attempting to use it. Can you uninstall the improperly installed gem and re-run puppet with --debug? I'm curious to see if your provided source is making it to the gem command.

I ran locally in Vagrant and looks like the desired behavior is taking place:

[root@sensu-server modules]# puppet resource package sensu-plugins-mysql ensure=latest provider=sensu_gem source=https://github.com/nagyt234/sensu-plugins-mysql.git --debug
<SNIP>
Debug: Executing: '/opt/sensu/embedded/bin/gem install --source https://github.com/nagyt234/sensu-plugins-mysql.git sensu-plugins-mysql'

@treydock
Copy link
Collaborator

treydock commented Jan 8, 2019

@nagyt234 Were you able to resolve this issue?

@ghoneycutt
Copy link
Collaborator

@nagyt234 Closing as @treydock shows this is not still an issue in his testing. If this is closed in error and this issue is still happening, please re-open it and we'll be happy to work with you on it.

@ghoneycutt
Copy link
Collaborator

Released in v2.60.0

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

No branches or pull requests

3 participants