Installing Specific RPM Version

251 views
Skip to first unread message

Douglas Garstang

unread,
Dec 14, 2009, 9:06:04 PM12/14/09
to Puppet Users
I'm trying to install/upgrade to a specific version of an RPM with
puppet. I'm getting the following:

Dec 14 17:58:40 papp1 puppetd[8438]:
(//Node[papp1.fr.xxx.com]/Elements::Setup[tfel0]/Package[tf-elements-core-tfel0]/ensure)
change from 1.0-1.tf to 14.3-0.tf failed: Could not update: Failed to
update to version 14.3-0.tf, got version 1.0-1.tf instead at
/etc/puppet/modules/elements/manifests/init.pp:31

My manifest at line 31 has:

package {
"tf-elements-core-${name}":
ensure => "14.3-0.tf";
}

The puppet documentation implies I can put a version number where I
have it. I currently have version 1.0-1 of the RPM installed.

papp1 ~:# rpm -qa | grep tf-elements-core
tf-elements-core-tfel0-1.0-1.tf

I haven't tried it yet, as it's ugly, but might this work?

package {
"tf-elements-core-${name}-14.3-0.tf":
ensure => installed;
}

I prefer the first though.

Doug.

Silviu Paragina

unread,
Dec 15, 2009, 12:58:56 AM12/15/09
to puppet...@googlegroups.com
Douglas Garstang wrote:
> I'm trying to install/upgrade to a specific version of an RPM with
> puppet. I'm getting the following:
>
> Dec 14 17:58:40 papp1 puppetd[8438]:
> (//Node[papp1.fr.xxx.com]/Elements::Setup[tfel0]/Package[tf-elements-core-tfel0]/ensure)
> change from 1.0-1.tf to 14.3-0.tf failed: Could not update: Failed to
> update to version 14.3-0.tf, got version 1.0-1.tf instead at
> /etc/puppet/modules/elements/manifests/init.pp:31
>
This means the support tools (yum/rpm I guess in your case) couldn't
find the version specified (14.3-0.tf), and the latest version it could
find was (1.0-1.tf). At least this is how I interpreted the message
(maybe someone could confirm).

What you should check:

1. Can yum install the version you want (14.3.....)? (try it from
command line on the client)
2. Is yum the default package provider for puppet?
run puppet on the client like this
puppetd --test --debug --trace --verbose
and check the output for the default package manager. (maybe
paste this here)

For 1 the solution is to configure yum so it can find the package. As I
am not familiar with yum I can't help you beyond this point if this is
the case.
For 2 well a lot of things can happen so post the debug output from the
client. :-)


Silviu

> My manifest at line 31 has:
>
> package {
> "tf-elements-core-${name}":
> ensure => "14.3-0.tf";
> }
>
> The puppet documentation implies I can put a version number where I
> have it. I currently have version 1.0-1 of the RPM installed.
>
> papp1 ~:# rpm -qa | grep tf-elements-core
> tf-elements-core-tfel0-1.0-1.tf
>
> I haven't tried it yet, as it's ugly, but might this work?
>
> package {
> "tf-elements-core-${name}-14.3-0.tf":
> ensure => installed;
> }
>
> I prefer the first though.
>
> Doug.
>
> --
>
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>
>

Douglas Garstang

unread,
Dec 15, 2009, 1:39:48 AM12/15/09
to puppet...@googlegroups.com
Silviu,

My system is aware of both the -1 and -2 releases in the repo.

This is before running puppet...

papp1 ~:# yum list tf-elements-core-tfel0-14.3-1.tf
[ stuff removed ]
Available Packages
tf-elements-core-tfel0.noarch
14.3-1.tf

papp1 ~:# yum list tf-elements-core-tfel0-14.3-2.tf
[ stuff removed ]
Available Packages
tf-elements-core-tfel0.noarch
14.3-2.tf

My manifest has:

package {
"tf-elements-core-14.3-1.tf":
ensure => "${release}";
}

and here's what puppet logs when it barfs:

debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q
tf-elements-core-tfel0 --nosignature --nodigest --qf %{NAME}
%|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
debug: //Node[papp1.fr.twofish.com]/Elements::Setup[tfel0]/Package[tf-elements-core-tfel0]:
Changing ensure
debug: //Node[papp1.fr.twofish.com]/Elements::Setup[tfel0]/Package[tf-elements-core-tfel0]:
1 change(s)
debug: Package[tf-elements-core-tfel0](provider=yum): Ensuring => 14.3-1.tf
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d
0 -e 0 -y install tf-elements-core-tfel0-14.3-1.tf'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q
tf-elements-core-tfel0 --nosignature --nodigest --qf %{NAME}
%|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
/usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:279:in `fail'
/usr/lib/ruby/site_ruby/1.8/puppet/type/package.rb:88
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:180:in `instance_eval'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:180:in `call_valuemethod'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:349:in `set'
/usr/lib/ruby/site_ruby/1.8/puppet/property.rb:421:in `sync'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:54:in `go'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:72:in `forward'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:118:in `apply_changes'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `apply_changes'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:83:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:426:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:238:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:426:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:309:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:124:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:256:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:181:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:255:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:237:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client.rb:136:in `runnow'
/usr/lib/ruby/site_ruby/1.8/puppet/network/client.rb:187:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:293:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:144:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:143:in `newthread'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:291:in `start'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:290:in `start'
/usr/sbin/puppetd:437
err: //Node[papp1.fr.twofish.com]/Elements::Setup[tfel0]/Package[tf-elements-core-tfel0]/ensure:
change from 14.3-2.tf to 14.3-1.tf failed: Could not update: Failed to
update to version 14.3
-1.tf, got version 14.3-2.tf instead at
/etc/puppet/modules/elements/manifests/init.pp:31

To my surprise, it appears that eventhough puppet complains with an
error, that it actually installed the RPM anyway. Excuting this right
after that puppet run:

papp1 ~:# rpm -qa tf-elements-core-tfel0
tf-elements-core-tfel0-14.3-1.tf

shows that release -1 was actually installed. Huh??? I'm suddenly
confused. That debug output there looks confusing. When puppet was
run, this RPM was NOT installed, and the manifest has ensure =>
"14.3-1.tf", but puppet it saying that it was trying to go from
version 14.3-2.tf to 14.3-1.tf.... What is puppet smoking???

Doug

Silviu Paragina

unread,
Dec 15, 2009, 5:01:17 AM12/15/09
to puppet...@googlegroups.com
Here puppet tells you what it is doing. This output leads me to believe
that "/usr/bin/yum -d 0 -e 0 -y install
tf-elements-core-tfel0-14.3-1.tf" ends with an error, but I might be
wrong considering the fact that I haven't ever used yum, and I have
failed to use rpm (back when I was a newbie using redhat).

Try switching the versions again and run these two commands puppet used,
adding a "&& echo Return code OK" for each just to be sure that the
return value is ok and see what you get.

SIDENOTE: this is a way of debugging something that isn't working in
puppet :-) execs or anything else.

Silviu
Reply all
Reply to author
Forward
0 new messages