Ask Your Question
2

Esure package installed fails if it is installed

asked 2013-05-20 04:34:42 -0500

1nd1go gravatar image

Hi!

Here is a part of my manifest:

package {'pgrepo':
   ensure => installed,
   source => "h__ttp://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm",
   provider => 'rpm',
}

When I execute it second time it gives me following error:

←[1;31mError: Execution of '/bin/rpm -i --oldpackage h__ttp://yum.postgresql.org/9
.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm' returned 1:     package
pgdg-centos92-9.2-6.noarch is already installed
←[0m
←[1;31mError: /Stage[main]//Package[pgrepo]/ensure: change from absent to presen
t failed: Execution of '/bin/rpm -i --oldpackage h__ttp://yum.postgresql.org/9.2/r
edhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
3

answered 2013-05-20 07:48:57 -0500

banjer gravatar image

updated 2013-05-21 07:08:22 -0500

I believe its an issue with your package $name. Try specifying the full name of the package instead of 'pgrepo', e.g.:

package {'pgdg-centos92-9.2-6.noarch.rpm':
   ensure => installed,
   source => "h__ttp://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm",
   provider => 'rpm',
}

You can get funky results as you've seen when the name is wrong. Also, the yumrepo puppet type might be better suited to manage adding this yum repository.

edit flag offensive delete link more

Comments

OK, you were near right :) it should be just 'pgdg-centos92-9.2-6.noarch'. I could make yumrepo for this repo work :( Thanks anyway.

1nd1go gravatar image1nd1go ( 2013-05-20 09:35:21 -0500 )edit
0

answered 2014-10-21 04:37:16 -0500

Andruss gravatar image

Found same problem with rpm package.

  1. Made a directory file { '/root/LB': ensure => directory, mode => '0755', owner => 'root', group => 'root', }
  2. 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', }
  3. 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

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 ? What i did wrong ?

edit flag offensive delete link more

Comments

@Andruss you should post this as a new question to get more attention, rather than an "answer" to an existing question. http://ask.puppetlabs.com/questions/ask/

banjer gravatar imagebanjer ( 2014-10-29 07:56:31 -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

Stats

Asked: 2013-05-20 04:34:42 -0500

Seen: 4,574 times

Last updated: May 21 '13