Hi everyone, I trying to notify a cache clean when creating a yumrepository: yumrepo { ''XXXXXXX'': descr => ''XXXXXX Packages'', baseurl => $url, require => [ Yum::Key[''0b6f8066''], ], gpgcheck => ''1'', enabled => ''1'', notify => [ Exec[''YUM Clean cache''], ], } exec { ''YUM Clean cache'': path => ''/bin:/usr/bin:/usr/local/bin'', user => ''root'', logoutput => true, refreshonly => true, command => ''yum clean all --verbose'', } And I am getting the following error on RedHat 6: info: Retrieving plugin info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb info: Loading facts in /var/lib/puppet/lib/facter/meminbytes.rb err: Could not retrieve catalog from remote server: Error 400 on SERVER: Can''t synthesize edge: File[/etc/yum.repos.d/XXX.repo] -notifies- Exec[YUM Clean cache] (param notify) info: Not using expired catalog for XXXX.fqdn from cache; expired at Wed Sep 12 17:03:31 +0200 2012 notice: Using cached catalog err: Could not retrieve catalog; skipping run Any idea what could be the problem? Regards, JM -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Thursday, September 13, 2012 4:13:26 AM UTC-5, A_SAAS wrote:> > Hi everyone, > > > I trying to notify a cache clean when creating a yumrepository: > yumrepo { ''XXXXXXX'': > descr => ''XXXXXX Packages'', > baseurl => $url, > require => [ Yum::Key[''0b6f8066''], ], > gpgcheck => ''1'', > enabled => ''1'', > notify => [ Exec[''YUM Clean cache''], ], > } > > exec { ''YUM Clean cache'': > path => ''/bin:/usr/bin:/usr/local/bin'', > user => ''root'', > logoutput => true, > refreshonly => true, > command => ''yum clean all --verbose'', > } > > And I am getting the following error on RedHat 6: > info: Retrieving plugin > info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb > info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb > info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb > info: Loading facts in /var/lib/puppet/lib/facter/meminbytes.rb > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Can''t synthesize edge: File[/etc/yum.repos.d/XXX.repo] -notifies- Exec[YUM > Clean cache] (param notify) > info: Not using expired catalog for XXXX.fqdn from cache; expired at Wed > Sep 12 17:03:31 +0200 2012 > notice: Using cached catalog > err: Could not retrieve catalog; skipping run > > Any idea what could be the problem? > >My first guess would be a parse-order issue. Try moving the declaration of the Exec before the declaration of the Yumrepo, or if they are in different classes then make sure the Exec''s class is parsed before the Yumrepo''s. My standard way to approach the latter situation would be to have the Yumrepo''s class ''include'' the Exec''s. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/aNQO7QnFIngJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
The exec and the yumrepo are declared in the same manifest even with declaring the exec before, it doesn''t help.... On Thu, Sep 13, 2012 at 3:09 PM, jcbollinger <John.Bollinger@stjude.org>wrote:> > > On Thursday, September 13, 2012 4:13:26 AM UTC-5, A_SAAS wrote: >> >> Hi everyone, >> >> >> I trying to notify a cache clean when creating a yumrepository: >> yumrepo { ''XXXXXXX'': >> descr => ''XXXXXX Packages'', >> baseurl => $url, >> require => [ Yum::Key[''0b6f8066''], ], >> gpgcheck => ''1'', >> enabled => ''1'', >> notify => [ Exec[''YUM Clean cache''], ], >> } >> >> exec { ''YUM Clean cache'': >> path => ''/bin:/usr/bin:/usr/local/bin''**, >> user => ''root'', >> logoutput => true, >> refreshonly => true, >> command => ''yum clean all --verbose'', >> } >> >> And I am getting the following error on RedHat 6: >> info: Retrieving plugin >> info: Loading facts in /var/lib/puppet/lib/facter/**root_home.rb >> info: Loading facts in /var/lib/puppet/lib/facter/**puppet_vardir.rb >> info: Loading facts in /var/lib/puppet/lib/facter/**facter_dot_d.rb >> info: Loading facts in /var/lib/puppet/lib/facter/**meminbytes.rb >> err: Could not retrieve catalog from remote server: Error 400 on SERVER: >> Can''t synthesize edge: File[/etc/yum.repos.d/XXX.**repo] -notifies- >> Exec[YUM Clean cache] (param notify) >> info: Not using expired catalog for XXXX.fqdn from cache; expired at Wed >> Sep 12 17:03:31 +0200 2012 >> notice: Using cached catalog >> err: Could not retrieve catalog; skipping run >> >> Any idea what could be the problem? >> >> > My first guess would be a parse-order issue. Try moving the declaration > of the Exec before the declaration of the Yumrepo, or if they are in > different classes then make sure the Exec''s class is parsed before the > Yumrepo''s. My standard way to approach the latter situation would be to > have the Yumrepo''s class ''include'' the Exec''s. > > > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/aNQO7QnFIngJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ok my bad, finally I taught the error was the yumrepo but it wasn''t. The error appears because of the following: file { ''/etc/yum.repos.d/XXXXXXX.repo'' : ensure => absent, path => ''/etc/yum.repos.d/XXXXX.repo'', notify => [ Exec[''YUM Clean cache''], ], } So I think the attribut ''ensure => absent'' is not a good candidat for notification. Thx for helping JM On Thu, Sep 13, 2012 at 3:42 PM, Antidot SAS <antidotsas@gmail.com> wrote:> The exec and the yumrepo are declared in the same manifest even with > declaring the exec before, it doesn''t help.... > > > > > On Thu, Sep 13, 2012 at 3:09 PM, jcbollinger <John.Bollinger@stjude.org>wrote: > >> >> >> On Thursday, September 13, 2012 4:13:26 AM UTC-5, A_SAAS wrote: >>> >>> Hi everyone, >>> >>> >>> I trying to notify a cache clean when creating a yumrepository: >>> yumrepo { ''XXXXXXX'': >>> descr => ''XXXXXX Packages'', >>> baseurl => $url, >>> require => [ Yum::Key[''0b6f8066''], ], >>> gpgcheck => ''1'', >>> enabled => ''1'', >>> notify => [ Exec[''YUM Clean cache''], ], >>> } >>> >>> exec { ''YUM Clean cache'': >>> path => ''/bin:/usr/bin:/usr/local/bin''**, >>> user => ''root'', >>> logoutput => true, >>> refreshonly => true, >>> command => ''yum clean all --verbose'', >>> } >>> >>> And I am getting the following error on RedHat 6: >>> info: Retrieving plugin >>> info: Loading facts in /var/lib/puppet/lib/facter/**root_home.rb >>> info: Loading facts in /var/lib/puppet/lib/facter/**puppet_vardir.rb >>> info: Loading facts in /var/lib/puppet/lib/facter/**facter_dot_d.rb >>> info: Loading facts in /var/lib/puppet/lib/facter/**meminbytes.rb >>> err: Could not retrieve catalog from remote server: Error 400 on SERVER: >>> Can''t synthesize edge: File[/etc/yum.repos.d/XXX.**repo] -notifies- >>> Exec[YUM Clean cache] (param notify) >>> info: Not using expired catalog for XXXX.fqdn from cache; expired at Wed >>> Sep 12 17:03:31 +0200 2012 >>> notice: Using cached catalog >>> err: Could not retrieve catalog; skipping run >>> >>> Any idea what could be the problem? >>> >>> >> My first guess would be a parse-order issue. Try moving the declaration >> of the Exec before the declaration of the Yumrepo, or if they are in >> different classes then make sure the Exec''s class is parsed before the >> Yumrepo''s. My standard way to approach the latter situation would be to >> have the Yumrepo''s class ''include'' the Exec''s. >> >> >> John >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/puppet-users/-/aNQO7QnFIngJ. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 13 September 2012 23:09, jcbollinger <John.Bollinger@stjude.org> wrote:> > > On Thursday, September 13, 2012 4:13:26 AM UTC-5, A_SAAS wrote: >> >> Hi everyone, >> >> >> I trying to notify a cache clean when creating a yumrepository: >> yumrepo { ''XXXXXXX'': >> descr => ''XXXXXX Packages'', >> baseurl => $url, >> require => [ Yum::Key[''0b6f8066''], ], >> gpgcheck => ''1'', >> enabled => ''1'', >> notify => [ Exec[''YUM Clean cache''], ], >> } >> >> exec { ''YUM Clean cache'': >> path => ''/bin:/usr/bin:/usr/local/bin'', >> user => ''root'', >> logoutput => true, >> refreshonly => true, >> command => ''yum clean all --verbose'', >> } >> >> And I am getting the following error on RedHat 6: >> info: Retrieving plugin >> info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb >> info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb >> info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb >> info: Loading facts in /var/lib/puppet/lib/facter/meminbytes.rb >> err: Could not retrieve catalog from remote server: Error 400 on SERVER: >> Can''t synthesize edge: File[/etc/yum.repos.d/XXX.repo] -notifies- Exec[YUM >> Clean cache] (param notify) >> info: Not using expired catalog for XXXX.fqdn from cache; expired at Wed >> Sep 12 17:03:31 +0200 2012 >> notice: Using cached catalog >> err: Could not retrieve catalog; skipping run >> >> Any idea what could be the problem? >> > > My first guess would be a parse-order issue. Try moving the declaration of > the Exec before the declaration of the Yumrepo, or if they are in different > classes then make sure the Exec''s class is parsed before the Yumrepo''s. My > standard way to approach the latter situation would be to have the Yumrepo''s > class ''include'' the Exec''s.Just as a point, the order things appear in a manifest has no impact of what "gets executed first". Its generally random unless you enforce an ordering scheme with the various ways of doing that. (require and/or resource chaining and such)> > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/aNQO7QnFIngJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.