Joey Locke
2007-Dec-21 18:22 UTC
RPM-installed packages trying to install every run, causing service to fail
Hi guys,
I''m doing some hackish stuff with manually installing RPMs. Basically
I''m pulling them down to /tmp and installing them using provider =>
rpm,
then making the service check that the package is installed before
it''ll
start. Here are the relevant sections of the pp file:
class tomcat inherits httpd {
$tomcat_connectors_pkg = $architecture ? {
i386 => "tomcat-connectors-1.2.25-1.i386.rpm",
x86_64 => "tomcat-connectors-1.2.25-1.x86_64.rpm"
}
$tomcat_native_pkg = $architecture ? {
i386 => "tomcat-native-1.1.10-1.i386.rpm",
x86_64 => "tomcat-native-1.1.10-1.x86_64.rpm",
}
file { "/tmp/$tomcat_connectors_pkg":
source =>
"puppet://puppet.corp.localmatters.com/dist/apps/tomcat/libraries/$tomcat_connectors_pkg",
mode => 644,
owner => root,
group => root,
before => Package["tomcat-connectors"]
}
file { "/tmp/$tomcat_native_pkg":
source =>
"puppet://puppet.corp.localmatters.com/dist/apps/tomcat/libraries/$tomcat_native_pkg",
mode => 644,
owner => root,
group => root,
before => Package["tomcat-native"]
}
package { $tomcat_connectors_pkg:
ensure => installed,
provider => rpm,
source => "/tmp/$tomcat_connectors_pkg",
alias => "tomcat-connectors",
}
package { $tomcat_native_pkg:
ensure => installed,
provider => rpm,
source => "/tmp/$tomcat_native_pkg",
alias => "tomcat-native",
}
service { tomcat:
ensure => running,
require => [
Package["tomcat-connectors"],Package["tomcat-native"] ]
}
I''m noticing that if the package is installed puppet will try to
install
it again and will fail because of a dependency error (because the
package is installed). Therefore, starting the service fails. Here''s
what I get with puppetd --verbose:
notice: Starting configuration run
err:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/httpd/tomcat/Package[tomcat-native-1.1.10-1.i386.rpm]/ensure:
change from absent to present failed: Execution of ''/bin/rpm -i
--oldpackage /tmp/tomcat-native-1.1.10-1.i386.rpm'' returned 256:
package tomcat-native-1.1.10-1 is already installed
err:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/httpd/tomcat/Package[tomcat-connectors-1.2.25-1.i386.rpm]/ensure:
change from absent to present failed: Execution of ''/bin/rpm -i
--oldpackage /tmp/tomcat-connectors-1.2.25-1.i386.rpm'' returned 256:
package tomcat-connectors-1.2.25-1 is already installed
err:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/modsecurity/Package[modsecurity-apache2-2.1.4-1.i386.rpm]/ensure:
change from absent to present failed: Execution of ''/bin/rpm -i
--oldpackage /tmp/modsecurity-apache2-2.1.4-1.i386.rpm'' returned 256:
package modsecurity-apache2-2.1.4-1 is already installed
notice:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/httpd/tomcat/Service[tomcat]:
Dependency package[tomcat-connectors-1.2.25-1.i386.rpm] has 1 failures
notice:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/httpd/tomcat/Service[tomcat]:
Dependency package[tomcat-native-1.1.10-1.i386.rpm] has 1 failures
warning:
//puppetclient/cfsandbox.corp.localmatters.com/webapp/httpd/tomcat/Service[tomcat]:
Skipping because of failed dependencies
I''m running puppet 0.23.2 on CentOS 5 (both server & client). Any
suggestions? Thanks in advance.
Joey
--
Joey Locke, Unix Geek <jlocke@localmatters.com>
Local Matters, Denver, Colorado, USA, North America, Earth
303-572-1122 x297
Joey Locke
2007-Dec-21 19:58 UTC
Re: RPM-installed packages trying to install every run, causing service to fail - SUMMARY
As it turns out, I was calling a variable that was setting the package
name to the name of the RPM:
package { $tomcat_connectors_pkg:
I changed it to the name RPM uses internally:
package { tomcat-connectors:
This worked and all is well. Thanks to lak on the #puppet channel for
the solution to this.
Joey
--
Joey Locke, Unix Geek <jlocke@localmatters.com>
Local Matters, Denver, Colorado, USA, North America, Earth
303-572-1122 x297