On Jun 27, 12:44 pm, Craig White <craig.wh...@ttiltd.com> wrote: > On Jun 25, 2011, at 7:51 AM, Nigel Kersten wrote: > > > On Fri, Jun 24, 2011 at 4:28 PM, Craig White <craig.wh...@ttiltd.com> wrote: > > >> 1. I want to require => > >> /etc/puppet/modules/custom/lib/facter/$SOME_CUSTOM_FACT is actually > >> executed and the fact is established before a particular package is > >> installed/configured. I can't seem to find the proper syntax for requiring > >> that fact first - before the attempted installation. > > > If you're distributing facts as plugins in modules like this, the > > pluginsync should cause the fact to be evaluated before the manifests > > are parsed and the catalog is compiled. > > > Something is going wrong if you're not getting your fact evaluated on > > first run. You definitely have pluginsync on on the node? > > ---- > Got this solved - custom facts syntax seems to be a little particular about > 'exec' commands and apparently much prefers 'system' commands and that is why > I was having issues getting it to run - fixed now. Yes, I had pluginsync on > the node.
This is not a peculiarity of custom facts. Ruby's 'exec' command (and the shell's and the corresponding family of C functions, etc.) don't just execute a command: they *replace* the currently running process with the specified command. Among other things, that means that the exec'ed command never returns (since there's nothing for it to return to); its exit is instead the end of the program. There are excellent reasons to want that behavior under some circumstances (often in conjunction with 'fork'; at some level this is how 'system' is implemented), but custom facts are not typically among those circumstances. Always choose 'system' instead of 'exec' unless you know exactly why you want the latter. Cheers, John -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.