Hi,

I'm using yum as our package provider and having an issue. Puppet is
complaining of the version, this is the code I'm trying to implement:

$snmp_version = "5.3.2.2"
package { "net-snmp": ensure => "${snmp_version}"; }

On the client I got:
debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: Changing
ensure
debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: 1 change(s)
debug: Package[net-snmp](provider=yum): Ensuring => 5.3.2.2
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0
-y install net-snmp-5.3.2.2' *(1)*
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q net-snmp
--nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION}
%{RELEASE} %{ARCH}
' *(2)*
err: //Node[client.example.com]/snmp::base/Package[net-snmp]/ensure: change
from 5.3.2.2-7.el5_4.2 to 5.3.2.2 failed: Could not update: Failed to update
to version *5.3.2.2*, got version *5.3.2.2-7.el5_4.2* instead at
/opt/git/development/modules/snmp/manifests/init.pp:26
notice: //Node[client.example.com]/snmp::base/File[/etc/snmp/snmpd.conf]:
Dependency package[net-snmp] has 1 failures
warning: 
//Node[labtest40-v3.ea-colo.ea.com]/snmp::base/File[/etc/snmp/snmpd.conf]:
Skipping because of failed dependencies

The package is installed*(1)* but the error is still shown at the time of
validation*(2)*.

Looking at the code I found:

in .../provider/package/yum.rb:
def install
---- chop lines ---

*    is = self.query*
    unless is
        raise Puppet::Error, "Could not find package %s" % self.name
    end

    # FIXME: Should we raise an exception even if should == :latest
    # and yum updated us to a version other than @param_hash[:ensure] ?
    if should && should != is[:ensure]
        raise Puppet::Error, "Failed to update to version #{*should*}, got
version #{*is[:ensure]*} instead"
    end

in .../provider/package/rpm.rb the query define comment says it will provide
the "version-release"
# Find the fully versioned package name and the version alone. Returns
# a hash with entries :instance => fully versioned package name, and
#* :ensure => version-release*
*def query*

The validation is made on what is provided in the ensure
attribute($snmp_version) against "version-release" installed.  I think it
makes sense when somebody defines something like ensure =>
"${snmp_version}-${snmp-release}", but not in my use case.

I would like to hear comments of my use case as it could probably would be a
valid feature request.

Thanks!

I'm Running(still) 0.24.8 on client and master.

-- 
Tony

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to