Ask Your Question
0

rpm packages

asked 2014-10-22 02:54:10 -0500

Andruss gravatar image

Found same problem with rpm package.

Made a directory

     file { '/root/LB': 
 ensure => directory, 
 mode => '0755',  
owner => 'root',  
group => 'root',  }

Fetched my file to it with:

file { "/root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm": 
mode => "0644", 
owner => 'root',
 group => 'root', 
 source => 'puppet:///modules/billingdb/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm', 
}

Then run an installation through:

package { 'LBcore-2.0base-006s-CentOS6x8664-20130622.rpm':
 ensure => installed, 
provider => 'rpm',
 #source => 'file:///modules/billingdb/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm',
source => 'file:///root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm', }

The problem is during synchronization of my node got the following:

Error: Execution of '/bin/rpm -i file:///root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm' returned 1: package LBcore-2.0base-006s.x86_64 is already installed

and

Error: /Stage[main]/Billingdb/Package[LBcore-2.0base-006s-CentOS6x8664-20130622.rpm]/ensure: change from absent to present failed: Execution of '/bin/rpm -i file:///root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm' returned 1: package LBcore-2.0base-006s.x86_64 is already installed

However when i ran manually :

 [root@node148 ~]# rpm -ivh /root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm Preparing... ########################################### [100%] package LBcore-2.0base-006s.x86_64 is already installed

Any ideas why the following error keep rising on every time during node synchronization. Shouldn''t puppet ignore it if package already had been installed i.e in previous session?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-10-22 07:36:36 -0500

Andruss gravatar image

Solved that issue thanks to Martin advise from bellow comments.

The package resource type title should have the package name

To found a right package name you need to discover it through

puppet resource package | grep -A10 LBcore (or grep the name of your package)

which gave me the following output:

    package { 'LBcore':
  ensure => '2.0base-006s',
}

hence package property should changed to:

 package { 'LBcore':
  #ensure => installed,
  ensure => '2.0base-006s',
  provider => 'rpm',
  #source => 'file:///modules/billingdb/LBcore-2.0base-006s-CentOS6_x86_64-20130622.rpm',
   source => 'file:///root/LB/LBcore-2.0base-006s-CentOS6_x86_64-20130622.rpm',
}

Cheers everybody...

edit flag offensive delete link more

Comments

Thank you! This solved my issue of not being able to upgrade an RPM package (using 'ensure' with the package version instead of specifying it in the package name).

smsearcy gravatar imagesmsearcy ( 2015-03-04 19:13:25 -0500 )edit
0

answered 2014-10-22 03:08:07 -0500

updated 2014-10-22 03:09:21 -0500

The package resource type title should have the package name, not the file name.

Try

package { 'LBcore-2.0base-006s-CentOS6x8664-20130622':
  ensure   => installed, 
  provider => 'rpm',
  source   => 'file:///root/LB/LBcore-2.0base-006s-CentOS6x8664-20130622.rpm', 
}

Besides this: copying large files via puppet file resource type is not recommended. Maybe you want to create a yum repo and use yumrepo and package types.

edit flag offensive delete link more

Comments

Well that exact solution doesn't help but help me to dig in right direction.Thanks a lot for feedback.

Andruss gravatar imageAndruss ( 2014-10-22 07:29:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-22 02:54:10 -0500

Seen: 3,670 times

Last updated: Oct 22 '14