Issue #14660 has been updated by James Turnbull.

Status changed from Unreviewed to Needs More Information
Assignee set to Evgeny Dudin

I can't replicate this. Can you show us the full output from just that 
resource?  

My resource:

<pre>
 package { "moneta":
  ensure      => "latest",
  provider    => "gem",
  source      => "http://mylocalrepo/gem-repository/";,
}
</pre>

I see with in the gem installed

<pre>
debug: Prefetching gem resources for package
debug: Puppet::Type::Package::ProviderGem: Executing '/usr/bin/gem list --local'
debug: Puppet::Type::Package::ProviderGem: Executing '/usr/bin/gem list 
--remote moneta$'
</pre>

Without the gem installed:

<pre>
debug: Puppet::Type::Package::ProviderGem: Executing '/usr/bin/gem list --local'
debug: Puppet::Type::Package::ProviderGem: Executing '/usr/bin/gem list --local 
moneta$'
debug: Package[moneta](provider=gem): Executing '/usr/bin/gem install 
--include-dependencies --source http://mylocalrepo/gem-repository/ moneta'
err: /Stage[main]//Package[moneta]/ensure: change from absent to latest failed: 
Could not update: Execution of '/usr/bin/gem install --include-dependencies 
--source http://mylocalrepo/gem-repository/ moneta' returned 1: ERROR:  Could 
not find a valid gem 'moneta' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SocketError: getaddrinfo: nodename nor servname provided, or not known 
(http://mylocalrepo/gem-repository/latest_specs.4.8.gz)
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
 at /tmp/gem.pp:5
</pre>

It logically fails because the local gem source doesn't exist but the correct 
command is run.

----------------------------------------
Bug #14660: package provider gem does not use the specified source if ensure => 
latest
https://projects.puppetlabs.com/issues/14660#change-63556

Author: Evgeny Dudin
Status: Needs More Information
Priority: Normal
Assignee: Evgeny Dudin
Category: package
Target version: 
Affected Puppet version: 2.7.14
Keywords: gem,latest,source
Branch: 


I have a local gem repository where I put my gems. In the manifest I specify a 
package with ensure => latest and explicitly set the source
<pre>
class trocla {
    package { "moneta":
        ensure      => "latest",
        provider    => "gem",
        source      => "http://mylocalrepo/gem-repository/";,
    }
}
</pre>
In spite of that, puppet does not use my repo to fetch the list of available 
gems (which is confusing - if I explicitly specify my custom repository, I 
expect this package to be pulled from this particular repository).

This can be seen in the output puppet with --debug option:
`debug: Puppet::Type::Package::ProviderGem: Executing '/usr/bin/gem list 
--remote moneta$'`
  As you can see --source option is missing here



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to