I have a basic setup where I have an Exec that is in a class. The Exec has an onlyif that checks for the existence of a file. Despite me indicating that the Class requires that File, the onlyif check is executed before the File. Basic example https://gist.github.com/b1e1741d686881f115c4 It works if I run apply twice (file gets created first time but exec doesn''t execute, exec gets run the second time) (I get the same behavior if I manually set up the File -> Exec relationship too, so I don''t think its related to the Class) -- 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/-/osNqluVlG3YJ. 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 obfuscation it seems you have done here doesn''t make this clear (at least to me). It would appear your "only if" is executing, as-directed, to see if it may execute the exec within the class. (Assuming you have replaced "apprunner" with "my_user" in places, there) It might help to de-obfuscate a bit ... or, make it clear where the users are the same/different before the obfuscated class and the (non-obfuscated?) log messages. On Mon, Apr 2, 2012 at 2:17 PM, John Shoemaker <john.shoemaker.9@gmail.com>wrote:> I have a basic setup where I have an Exec that is in a class. The Exec has > an onlyif that checks for the existence of a file. Despite me indicating > that the Class requires that File, the onlyif check is executed before the > File. > > Basic example > > https://gist.github.com/b1e1741d686881f115c4 > > It works if I run apply twice (file gets created first time but exec > doesn''t execute, exec gets run the second time) > > (I get the same behavior if I manually set up the File -> Exec > relationship too, so I don''t think its related to the Class) > > -- > 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/-/osNqluVlG3YJ. > 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.
I''ll try creating a real single file example that shows the issue. If I put a "Require" on the exec itself, it works. It seems intuitive to me that if I setup Class -> File, then the File should get executed before anything in that Class. But that isn''t the case. On Monday, April 2, 2012 2:51:33 PM UTC-7, Russell VT wrote:> > The obfuscation it seems you have done here doesn''t make this clear (at > least to me). > > It would appear your "only if" is executing, as-directed, to see if it may > execute the exec within the class. (Assuming you have replaced "apprunner" > with "my_user" in places, there) > > It might help to de-obfuscate a bit ... or, make it clear where the users > are the same/different before the obfuscated class and the > (non-obfuscated?) log messages. > > > > On Mon, Apr 2, 2012 at 2:17 PM, John Shoemaker <john.shoemaker.9@gmail.com > > wrote: > >> I have a basic setup where I have an Exec that is in a class. The Exec >> has an onlyif that checks for the existence of a file. Despite me >> indicating that the Class requires that File, the onlyif check is executed >> before the File. >> >> Basic example >> >> https://gist.github.com/b1e1741d686881f115c4 >> >> It works if I run apply twice (file gets created first time but exec >> doesn''t execute, exec gets run the second time) >> >> (I get the same behavior if I manually set up the File -> Exec >> relationship too, so I don''t think its related to the Class) >> >> -- >> 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/-/osNqluVlG3YJ. >> 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 view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/7QtP-o8vodwJ. 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.