Mike
2012-Mar-08 22:05 UTC
[Puppet Users] Puppet returns an error if a package is already installed
I''m very new to Puppet, and new to this group, so I apologize if this has already been covered. I did a quick search but didn''t quickly find an answer. I have a manifest that among other things installs a couple of packages. These are not part of a repository, so I use puppet to send the rpm file to the agent, then do the installation. This works just fine if the package is not already installed. However, if the package is already installed, it returns an error. This has to be a bug, right? package { ''jdk-6u16-linux-amd64.rpm'': ensure => installed, source => "/usr/java/jdk-6u16-linux-amd64.rpm", require => File[''jdk-6u16-linux-amd64.rpm''], } the error: err: /Stage[main]/Ulbridge/Package[jdk-6u16-linux-amd64.rpm]/ensure: change from absent to present failed: Execution of ''/bin/rpm -i --oldpackage /usr/java/jdk-6u16-linux-amd64.rpm'' returned 1: package jdk-1.6.0_16-fcs.x86_64 is already installed If I then have another file/package/whatever that depends on that package (require => Package[''jdk-6u16-linux-amd64.rpm'']) it will fail because the package errored out. This isn''t by design, is it? How do I get around it? -- 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/-/hptNNLkVVjkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nan Liu
2012-Mar-08 23:09 UTC
Re: [Puppet Users] Puppet returns an error if a package is already installed
On Thu, Mar 8, 2012 at 2:05 PM, Mike <mrwboilers@gmail.com> wrote:> I''m very new to Puppet, and new to this group, so I apologize if this has > already been covered. I did a quick search but didn''t quickly find an > answer. > > I have a manifest that among other things installs a couple of packages. > These are not part of a repository, so I use puppet to send the rpm file to > the agent, then do the installation. This works just fine if the package is > not already installed. However, if the package is already installed, it > returns an error. This has to be a bug, right? > > package { ''jdk-6u16-linux-amd64.rpm'': > ensure => installed, > source => "/usr/java/jdk-6u16-linux-amd64.rpm", > require => File[''jdk-6u16-linux-amd64.rpm''], > }From the output below the name of the package should just simply be jdk instead of jdk-6u16..., use the command ''puppet resource package'' and look at the output for a better idea.> the error: > > err: /Stage[main]/Ulbridge/Package[jdk-6u16-linux-amd64.rpm]/ensure: change > from absent to present failed: Execution of ''/bin/rpm -i --oldpackage > /usr/java/jdk-6u16-linux-amd64.rpm'' returned 1: package > jdk-1.6.0_16-fcs.x86_64 is already installed > > If I then have another file/package/whatever that depends on that package > (require => Package[''jdk-6u16-linux-amd64.rpm'']) it will fail because the > package errored out. This isn''t by design, is it? How do I get around it?HTH, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mike
2012-Mar-09 14:54 UTC
[Puppet Users] Re: Puppet returns an error if a package is already installed
Thank you so much. That solved my problem. On Thursday, March 8, 2012 4:05:05 PM UTC-6, Mike wrote:> > I''m very new to Puppet, and new to this group, so I apologize if this has > already been covered. I did a quick search but didn''t quickly find an > answer. > > I have a manifest that among other things installs a couple of packages. > These are not part of a repository, so I use puppet to send the rpm file to > the agent, then do the installation. This works just fine if the package is > not already installed. However, if the package is already installed, it > returns an error. This has to be a bug, right? > > package { ''jdk-6u16-linux-amd64.rpm'': > ensure => installed, > source => "/usr/java/jdk-6u16-linux-amd64.rpm", > require => File[''jdk-6u16-linux-amd64.rpm''], > } > > the error: > > err: /Stage[main]/Ulbridge/Package[jdk-6u16-linux-amd64.rpm]/ensure: > change from absent to present failed: Execution of ''/bin/rpm -i > --oldpackage /usr/java/jdk-6u16-linux-amd64.rpm'' returned 1: package > jdk-1.6.0_16-fcs.x86_64 is already installed > > If I then have another file/package/whatever that depends on that package > (require => Package[''jdk-6u16-linux-amd64.rpm'']) it will fail because the > package errored out. This isn''t by design, is it? How do I get around it? >-- 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/-/_xT4fP9rb-UJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.