Package install from a URL

13,348 views
Skip to first unread message

matonb

unread,
Sep 3, 2012, 8:26:30 AM9/3/12
to puppet...@googlegroups.com
puppet-server 2.7.19 on CentOS 6.3 x64
 
I have the follow very bsaic class, which I would expect to install the package if it's not already  present on the system:
 
class yum::repos::puppetlabs {
  package { 'puppetlabs-release':
    ensure => installed,
    source => 'http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-5.noarch.rpm',
  }
}
It doesn't appear to use the source value, simply the package name in the yum command:
 
err: /Stage[main]/Yum::Repos::Puppetlabs/Package[puppetlabs-release]/
ensure: change from absent to present failed:
Execution of '/usr/bin/yum -d 0 -e 0 -y install puppetlabs-release' returned 1: Error: Nothing to do
 
If I manually install with
 
It works just fine.
 
Any help appreciated.

David Schmitt

unread,
Sep 3, 2012, 8:36:08 AM9/3/12
to puppet...@googlegroups.com
I always recommend downloading and verifying installing such important
packages manually and then deploy and install them as a file+package.

Not using https here is just handing out your keys to any stranger on
the net.



Best Regards, David

Mark Roggenkamp

unread,
Sep 3, 2012, 9:36:19 AM9/3/12
to puppet...@googlegroups.com
I believe it will work if you change the provider to rpm in this case (provider => rpm,).

Mark

Jonathan Gazeley

unread,
Sep 3, 2012, 9:38:23 AM9/3/12
to puppet...@googlegroups.com
Yes, this is correct. But note that rpm can't do dependencies like yum -
you will need to install the dependencies by hand using other package{}
declarations and use requires=>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/zucqpv-FNXUJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Stefan Schulte

unread,
Sep 3, 2012, 2:45:36 PM9/3/12
to puppet...@googlegroups.com
The package type actually has a lot of parameters that are only used by
a subset of all providers. Like "category" is only used on gentoo (i
guess) and "adminfile" is a solaris pkgadd specific.

If you think that source should not only be respected by the rpm
provider but also in the yum provider you should file a feature request:

http://projects.puppetlabs.com/issues

-Stefan

Jonathan Rose

unread,
Jul 7, 2014, 4:54:50 PM7/7/14
to puppet...@googlegroups.com
I tried fiddling around with a puppet module I am writing to install RPM's both from repository as well as local resources (e.g. http) and tried the advise noted by David Caro, but I'm still getting error messages:

Skipping.
Error: Nothing to do
returned 1: Cannot open:


On Tuesday, February 12, 2013 4:35:08 AM UTC-5, David Caro wrote:

As I've seen in the code, th eyum provider passes the name of the package to yum, so instead of using source you should use name:


class yum::repos::puppetlabs {
  package { 'puppetlabs-release':
    ensure => installed,

jcbollinger

unread,
Jul 8, 2014, 9:27:19 AM7/8/14
to puppet...@googlegroups.com


On Monday, July 7, 2014 3:54:50 PM UTC-5, Jonathan Rose wrote:
I tried fiddling around with a puppet module I am writing to install RPM's both from repository as well as local resources (e.g. http) and tried the advise noted by David Caro, but I'm still getting error messages:

Skipping.
Error: Nothing to do
returned 1: Cannot open:



David's advice is unfortunately un-sound.  You do not normally need to use the "name" parameter with the 'yum' package provider, because yum normally uses the package name as the desired RPM name.  That is, simply:

package { 'my-package-name':
    ensure => 'installed',
}


Note that that's normally just the package name as it will be recorded in the RPM database, not the RPM filename.  But that only works if the specified package is in one of the yum package repositories that your system is already configured to use.  Your objective here appears to be to configure a package repository that may not already be configured, and for that you cannot use the 'yum' provider at all -- it's simply not the way Yum works.

If you want to manage an RPM package from a specific local or http[s] source that you specify, then you need to ensure that the 'rpm' provider be used.  On most systems that use RPMs, the default provider is something more flexible, such as 'yum', so you need to declare the 'rpm' provider specifically if you want to use it (i.e. what Mark wrote).  Note also Jonathan's comments about package dependencies, which are the reason other providers are preferred to the plain 'rpm' provider for most purposes.  Dependencies should not be an issue for your particular case, so probably this will work:

package { 'puppetlabs-release':
  ensure => 'installed',
  source => 'https://yum.puppetlabs.com/el/
6/products/x86_64/puppetlabs-release-6-5.noarch.rpm',
  provider => 'rpm'
}



John

Jonathan Rose

unread,
Aug 5, 2014, 12:37:57 PM8/5/14
to puppet...@googlegroups.com
Switching provider to 'rpm' fixes the issue reported above, BUT creates another issue in its place. Mind you, now the issue is with installing OpenSSL and OpenSSL-Devel rpms that were patched against Heartbleed and getting a mess of dependency errors. Any suggestions?
Reply all
Reply to author
Forward
0 new messages