Install local rpm with puppet

900 views
Skip to first unread message

Juliano Resende

unread,
Aug 21, 2014, 1:50:56 PM8/21/14
to puppet...@googlegroups.com
Hi people,

I created a module to install some rpms, but after rpm is installed, in the next time the agent go check for new changes in my puppet master, i get the error with the information that rpm packages is already installed.

My module 

 package {'epel-repo-centos7':
                  ensure => present,
                  provider => 'rpm',
                  install_options => ['-ivh'],
                  source => "/tmp/epel-release-7-0.2.noarch.rpm",
                  require => File["/tmp/epel-release-7-0.2.noarch.rpm"],
              }
 file { "/tmp/epel-release-7-0.2.noarch.rpm":
                  source => "puppet:///modules/repository/epel-release-7-0.2.noarch.rpm"
 }

Error

LevelMessageSourceFileLineTime
errExecution of '/bin/rpm -i -ivh /tmp/epel-release-7-0.2.noarch.rpm' returned 1: Preparing... ################################################## package puppetlabs-release-6-10.noarch is already installedPuppet2014-08-21 13:46 BRT
errchange from absent to present failed: Execution of '/bin/rpm -i -ivh /tmp/epel-release-7-0.2.noarch.rpm' returned 1: Preparing... ################################################## package epel-release-7-0.2.noarch.rpm is already installed/Stage[main]/Core::Repository/Package[epel-release-7]/ensure/etc/puppet/environments/production/modules/core/manifests/repository.pp572014-08-21 13:46 BRT

Somebody knows why?

Thanks.

At,

Juliano Resende - Brasil

Juliano Resende

unread,
Aug 21, 2014, 2:55:53 PM8/21/14
to puppet...@googlegroups.com
Hi,

I made a mistake, the name of the rpm package is wrong, the correct form is

 package {'epel-release-7-0.2.noarch':
                 ensure => present,
                 provider => 'rpm',
                 install_options => ['-ivh'],
                 source => "/tmp/epel-release-6-8.noarch.rpm",
                 require => File["/tmp/epel-release-6-8.noarch.rpm"],
             }
             file { "/tmp/epel-release-6-8.noarch.rpm":
                 source => "puppet:///modules/core/repository/epel-release-6-8.noarch.rpm"
             }

Thanks any way

Yanis Guenane

unread,
Aug 22, 2014, 7:55:58 AM8/22/14
to puppet...@googlegroups.com
Hi Juliano,

>> package epel-release-7-0.2.noarch.rpm is already installed

You are using -ivh, so if package is already installed it will fail.
Which is apparently the case.
You should use -Uvh, (U for upgrade) meaning in case the package you try
to install is more recent that the one that is installed, it will
upgrade it.

Also not sure why you don't use the EPEL module on the forge
https://forge.puppetlabs.com/stahnma/epel, which does install EPEL
pretty well.

Hope it helps,

--
Yanis Guenane
>> BRTerrchange from absent to present failed: Execution of '/bin/rpm -i
Reply all
Reply to author
Forward
0 new messages