onlyif executed out of order

36 views
Skip to first unread message

John Shoemaker

unread,
Apr 2, 2012, 5:17:10 PM4/2/12
to puppet...@googlegroups.com
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


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)

Russell Van Tassell

unread,
Apr 2, 2012, 5:51:33 PM4/2/12
to puppet...@googlegroups.com
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.



--
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...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

John Shoemaker

unread,
Apr 2, 2012, 6:23:15 PM4/2/12
to puppet...@googlegroups.com
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.


To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages