aberoham@gmail.com
2007-Jul-17 23:10 UTC
Yumrepo''s subscribe ran before package require Yumrepo?
I am trying to set a "subscribe" for a Yumrepo object so that an Exec
"yum
clean all" is ran immediately after a Yumrepo is changed. With the
following
setup, I am not seeing the "subscribe" fire off until after Packages
that
have a require pointing to the Yumrepo["custom"] are attempted to be
installed.
Is in right to expect that the subscribe on the Yumrepo object should get
triggered before the packages that require that Yumrepo are
installed/created?
Abe
----
class common-yum {
yumrepo { base:
name => "base",
baseurl => "
http://admin001/yum_reorg/$operatingsystem/\$releasever/base/\$basearch/",
descr => "$operatingsystem \$releasever - \$basearch -
base",
enabled => 1,
enablegroups => 1,
exclude => "*perl*",
gpgcheck => 0,
require => [
File["/etc/yum.repos.d/CentOS-Base.repo"] ]
}
yumrepo { custom:
name => "custom",
baseurl => "
http://admin001/yum_reorg/$operatingsystem/\$releasever/custom/\$basearch/",
descr => "$operatingsystem \$releasever - \$basearch -
custom",
enabled => 1,
enablegroups => 1,
gpgcheck => 0,
require => [
File["/etc/yum.repos.d/CentOS-Base.repo"] ]
}
file { "/etc/yum.repos.d/CentOS-Base.repo":
ensure => absent
}
exec { "yum-clean-all":
path =>
''/bin:/usr/bin:/usr/sbin:/usr/local/bin'',
subscribe => [ Yumrepo["base"],
Yumrepo["custom"] ],
command => "yum clean all"
}
}
class common-packages {
package { perl-Sub-Name: ensure => installed, require => [
Yumrepo[custom] ] }
# [snip]
}
---
log from puppet -v
---
info: create new repo custom in file /etc/yum.repos.d/custom.repo
notice: //common-yum/Yumrepo[custom]/descr: descr changed ''''
to ''CentOS
$releasever - $basearch - custom''
notice: //common-yum/Yumrepo[custom]/baseurl: baseurl changed
'''' to ''
http://admin001/yum_reorg/CentOS/$releasever/custom/$basearch/''
notice: //common-yum/Yumrepo[custom]/enabled: enabled changed
'''' to ''1''
notice: //common-yum/Yumrepo[custom]/gpgcheck: gpgcheck changed
'''' to ''0''
notice: //common-yum/Yumrepo[custom]/enablegroups: enablegroups changed
''''
to ''1''
info: //common-yum/Yumrepo[custom]: Scheduling refresh of
Exec[yum-clean-all]
info: //common-yum/Yumrepo[custom]: Scheduling refresh of
Exec[yum-clean-all]
info: //common-yum/Yumrepo[custom]: Scheduling refresh of
Exec[yum-clean-all]
info: //common-yum/Yumrepo[custom]: Scheduling refresh of
Exec[yum-clean-all]
info: //common-yum/Yumrepo[custom]: Scheduling refresh of
Exec[yum-clean-all]
notice: //common-packages/Package[perl-Math-Random]/ensure: created
notice: //common-packages/Package[perl-Class-Accessor]/ensure: created
notice: //common-packages/Package[perl-List-MoreUtils]/ensure: created
notice: //common-packages/Package[perl-String-ShellQuote]/ensure: created
notice: //common-packages/Package[perl-MD5]/ensure: created
notice: //common-packages/Package[perl-FreezeThaw]/ensure: created
notice: //common-packages/Package[perl-Sub-Name]/ensure: created
notice: //common-packages/Package[perl-XML-XPath]/ensure: created
notice: //common-yum/Exec[yum-clean-all]/returns: executed successfully
notice: //common-yum/Exec[yum-clean-all]: Triggering ''refresh''
from 5
dependencies
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
Luke Kanies
2007-Jul-18 15:46 UTC
Re: Yumrepo''s subscribe ran before package require Yumrepo?
On Jul 17, 2007, at 6:10 PM, aberoham@gmail.com wrote:> > I am trying to set a "subscribe" for a Yumrepo object so that an > Exec "yum clean all" is ran immediately after a Yumrepo is changed. > With the following setup, I am not seeing the "subscribe" fire off > until after Packages that have a require pointing to the Yumrepo > ["custom"] are attempted to be installed. > > Is in right to expect that the subscribe on the Yumrepo object > should get triggered before the packages that require that Yumrepo > are installed/created?You''ve only said that the exec and all of the packages should get run after the yumrepo, you haven''t said anything about the packages'' relationship to the exec, so Puppet doesn''t know where the exec should fall. You should have your packages depend on the exec, not the yumrepo. -- In our civilization, and under our republican form of government, intelligence is so highly honored that it is rewarded by exemption from the cares of office. --Ambrose Bierce --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com