I''m using puppet 0.24.7. I have the following simple setup: define buildout($path, $eggs, $python) { file { $path: ensure => directory, } file { "$path/bootstrap.py": source => "puppet:///pythonutils/bootstrap.py" } file { "$path/buildout.cfg": content => template("pythonutils/buildout.cfg"), } exec { "bootstrap_$path": require => [File["$path/bootstrap.py"], File["$path/ buildout.cfg"]], command => "cd $path; python2.5 bootstrap.py", unless => "test -d $path/bin", } exec { "build_$path": require => Exec["bootstrap_$path"], command => "cd $path; ./bin/buildout", subscribe => File["$path/buildout.cfg"], refreshonly => true } } The bottom resource depends on the one above it. But if that one initially fails to run, then the bottom one will not be triggered when it eventually does. Is this expected behaviour when refreshonly is set? Regards, Graham --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
paul matthews
2009-Apr-08 11:57 UTC
[Puppet Users] Re: Refreshonly and failed dependencies
To ensure one follows the other how about adding a notify statement in the second but one statement. As for your question it looks like it should run if the initial run fails and subsequently works. Are you sure the test -d $path/bin condition is being met? exec { "bootstrap_$path": require => [File["$path/bootstrap.py"], File["$path/ buildout.cfg"]], command => "cd $path; python2.5 bootstrap.py", unless => "test -d $path/bin", notify => Exec { "build_$path" } } Paul 2009/4/8 Graham Stratton <grahams@mocomedia.net>> > I''m using puppet 0.24.7. I have the following simple setup: > > > define buildout($path, $eggs, $python) { > file { $path: > ensure => directory, > } > file { "$path/bootstrap.py": > source => "puppet:///pythonutils/bootstrap.py" > } > file { "$path/buildout.cfg": > content => template("pythonutils/buildout.cfg"), > } > exec { "bootstrap_$path": > require => [File["$path/bootstrap.py"], File["$path/ > buildout.cfg"]], > command => "cd $path; python2.5 bootstrap.py", > unless => "test -d $path/bin", > } > exec { "build_$path": > require => Exec["bootstrap_$path"], > command => "cd $path; ./bin/buildout", > subscribe => File["$path/buildout.cfg"], > refreshonly => true > } > } > > The bottom resource depends on the one above it. But if that one > initially fails to run, then the bottom one will not be triggered when > it eventually does. Is this expected behaviour when refreshonly is set? > > Regards, > > Graham > > > >-- Paul Matthews ---------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Graham Stratton
2009-Apr-09 00:03 UTC
[Puppet Users] Re: Refreshonly and failed dependencies
On 08/04/2009, at 9:57 PM, paul matthews wrote:> To ensure one follows the other how about adding a notify statement > in the second but one statement. As for your question it looks like > it should run if the initial run fails and subsequently works. Are > you sure the test -d $path/bin condition is being met?Yes, that condition is met and that resource is executed. But if it fails the first time and succeeds on a later run, the bottom resource is never executed.> exec { "bootstrap_$path": > require => [File["$path/bootstrap.py"], File["$path/ > buildout.cfg"]], > command => "cd $path; python2.5 bootstrap.py", > unless => "test -d $path/bin", > notify => Exec { "build_$path" } > } > > PaulI''ve fixed my problem by changing replacing refreshonly with creates, but I''m still wondering whether this is desired behavior?> > 2009/4/8 Graham Stratton <grahams@mocomedia.net> > > I''m using puppet 0.24.7. I have the following simple setup: > > > define buildout($path, $eggs, $python) { > file { $path: > ensure => directory, > } > file { "$path/bootstrap.py": > source => "puppet:///pythonutils/bootstrap.py" > } > file { "$path/buildout.cfg": > content => template("pythonutils/buildout.cfg"), > } > exec { "bootstrap_$path": > require => [File["$path/bootstrap.py"], File["$path/ > buildout.cfg"]], > command => "cd $path; python2.5 bootstrap.py", > unless => "test -d $path/bin", > } > exec { "build_$path": > require => Exec["bootstrap_$path"], > command => "cd $path; ./bin/buildout", > subscribe => File["$path/buildout.cfg"], > refreshonly => true > } > } > > The bottom resource depends on the one above it. But if that one > initially fails to run, then the bottom one will not be triggered when > it eventually does. Is this expected behaviour when refreshonly is > set? > > Regards, > > Graham--~--~---------~--~----~------------~-------~--~----~ 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 Apr 8, 2009, at 3:58 AM, Graham Stratton wrote:> > I''m using puppet 0.24.7. I have the following simple setup: > > > define buildout($path, $eggs, $python) { > file { $path: > ensure => directory, > } > file { "$path/bootstrap.py": > source => "puppet:///pythonutils/bootstrap.py" > } > file { "$path/buildout.cfg": > content => template("pythonutils/buildout.cfg"), > } > exec { "bootstrap_$path": > require => [File["$path/bootstrap.py"], File["$path/ > buildout.cfg"]], > command => "cd $path; python2.5 bootstrap.py", > unless => "test -d $path/bin", > } > exec { "build_$path": > require => Exec["bootstrap_$path"], > command => "cd $path; ./bin/buildout", > subscribe => File["$path/buildout.cfg"], > refreshonly => true > } > } > > The bottom resource depends on the one above it. But if that one > initially fails to run, then the bottom one will not be triggered when > it eventually does. Is this expected behaviour when refreshonly is > set?Any resource subscribing to another resource should *always* run when that subcribed-to resource changes something. But there''s got to be something else going on; Puppet doesn''t maintain state between runs, so either it fires off an event or it doesn''t, and if it does, then the other resource should get triggered. -- It''s a small world, but I wouldn''t want to paint it. -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Graham Stratton
2009-Apr-09 02:27 UTC
[Puppet Users] Re: Refreshonly and failed dependencies
On 09/04/2009, at 12:11 PM, Luke Kanies wrote:> > On Apr 8, 2009, at 3:58 AM, Graham Stratton wrote: > >> >> I''m using puppet 0.24.7. I have the following simple setup: >> >> >> define buildout($path, $eggs, $python) { >> file { $path: >> ensure => directory, >> } >> file { "$path/bootstrap.py": >> source => "puppet:///pythonutils/bootstrap.py" >> } >> file { "$path/buildout.cfg": >> content => template("pythonutils/buildout.cfg"), >> } >> exec { "bootstrap_$path": >> require => [File["$path/bootstrap.py"], File["$path/ >> buildout.cfg"]], >> command => "cd $path; python2.5 bootstrap.py", >> unless => "test -d $path/bin", >> } >> exec { "build_$path": >> require => Exec["bootstrap_$path"], >> command => "cd $path; ./bin/buildout", >> subscribe => File["$path/buildout.cfg"], >> refreshonly => true >> } >> } >> >> The bottom resource depends on the one above it. But if that one >> initially fails to run, then the bottom one will not be triggered >> when >> it eventually does. Is this expected behaviour when refreshonly is >> set? > > Any resource subscribing to another resource should *always* run when > that subcribed-to resource changes something.Yes, but in this instance it''s not subscribed to it, it only requires it. It is also subscribed to a file resource, and it does correctly refresh whenever that file is modified. Regards, Graham --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Graham Stratton
2009-Apr-09 02:50 UTC
[Puppet Users] Re: Refreshonly and failed dependencies
On 09/04/2009, at 12:11 PM, Luke Kanies wrote:> > On Apr 8, 2009, at 3:58 AM, Graham Stratton wrote: > >> >> I''m using puppet 0.24.7. I have the following simple setup: >> >> >> define buildout($path, $eggs, $python) { >> file { $path: >> ensure => directory, >> } >> file { "$path/bootstrap.py": >> source => "puppet:///pythonutils/bootstrap.py" >> } >> file { "$path/buildout.cfg": >> content => template("pythonutils/buildout.cfg"), >> } >> exec { "bootstrap_$path": >> require => [File["$path/bootstrap.py"], File["$path/ >> buildout.cfg"]], >> command => "cd $path; python2.5 bootstrap.py", >> unless => "test -d $path/bin", >> } >> exec { "build_$path": >> require => Exec["bootstrap_$path"], >> command => "cd $path; ./bin/buildout", >> subscribe => File["$path/buildout.cfg"], >> refreshonly => true >> } >> } >> >> The bottom resource depends on the one above it. But if that one >> initially fails to run, then the bottom one will not be triggered >> when >> it eventually does. Is this expected behaviour when refreshonly is >> set? > > > Any resource subscribing to another resource should *always* run when > that subcribed-to resource changes something. > > But there''s got to be something else going on; Puppet doesn''t maintain > state between runs, so either it fires off an event or it doesn''t, and > if it does, then the other resource should get triggered.Ah, okay, I understand now. So the refreshonly was meaning that the bottom resource was only running when the file resource changed. But if on the same run that file changed the resource that it requires failed, then it would never run. I had this idea that refreshonly should mean that it ran at least once, but that''s not guaranteed. I''ve now moved to using unless instead of refreshonly and have the behavior I want. Sorry for the noise. Regards, Graham --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---