Hi all,
Not sure if this is a bug in puppet, yum, or just something I'm doing wrong.
I'm trying to use puppet to update a package to a particular version and exec
a command when that update is applied.
The problem is, puppet calls yum which successfully updates the package, but
puppet then thinks the update has failed and hence doesn't trigger the exec.
Next cycle the package is already the correct version, so the update isn't
applied, so the exec is never called.
manifest snippet:
package { "test":
ensure => "1.21",
}
exec { "testcmd":
command => "/foo/bar",
refreshonly => true,
subscribe => package["test"]
}
Output from puppetd:
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y install test-1.21'
/usr/lib/site_ruby/1.8/puppet/parameter.rb:279:in `fail'
/usr/lib/site_ruby/1.8/puppet/type/package.rb:88
/usr/lib/site_ruby/1.8/puppet/type/package.rb:84:in `instance_eval'
/usr/lib/site_ruby/1.8/puppet/property.rb:181:in `instance_eval'
/usr/lib/site_ruby/1.8/puppet/property.rb:181:in `call_valuemethod'
/usr/lib/site_ruby/1.8/puppet/property.rb:350:in `set'
/usr/lib/site_ruby/1.8/puppet/property.rb:422:in `sync'
/usr/lib/site_ruby/1.8/puppet/propertychange.rb:81:in `go'
/usr/lib/site_ruby/1.8/puppet/propertychange.rb:109:in `forward'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:117:in `apply_changes'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:109:in `collect'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:109:in `apply_changes'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:81:in `apply'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:238:in `eval_resource'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:237:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/util.rb:444:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:342:in `realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:309:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:308:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/util.rb:444:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:342:in `realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:302:in `collect'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:302:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/node/catalog.rb:118:in `apply'
/usr/lib/site_ruby/1.8/puppet/network/client/master.rb:264:in `run'
/usr/lib/site_ruby/1.8/puppet/network/client/master.rb:263:in `benchmark'
/usr/lib/site_ruby/1.8/puppet/util.rb:211:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:342:in `realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/site_ruby/1.8/puppet/network/client/master.rb:263:in `run'
/usr/lib/site_ruby/1.8/puppet/network/client/master.rb:245:in `synchronize'
/usr/lib/site_ruby/1.8/puppet/network/client/master.rb:245:in `run'
/usr/bin/puppetd:439
err: /:main/Node[testnode]/test/Package[test]/ensure: change from 1.20 to 1.21 failed:
Could not update: Failed to update to version1.21, got version 1.20 instead at
/etc/puppet/modules/test/manifests/init.pp:28
notice: /:main/Node[testnode]/test/Exec[testcmd]: Dependency package[test] has 1 failures
warning: /:main/Node[testnode]/test/Exec[testcmd]: Skipping because of failed dependencies
The package is successfully updated to 1.21 though, and the yum command -
'/usr/bin/yum -d 0 -e 0 -y install test-1.21' - also works fine with returncode
0 and no errors when run independently. So I'm not sure why puppet is reporting
'failed to update'.
Any ideas? O/S is Scientific Linux 4 (RHEL4), yum version is 2.4.2,
puppet version is 0.24.4.
Thanks,
Rob
--
Robert Fay f...@hep.ph.liv.ac.uk
System Administrator office: 210
High Energy Physics Division tel (int): 43396
Oliver Lodge Laboratory tel (ext): +44 (0)151 794 3396
University of Liverpool http://hep.ph.liv.ac.uk