> well imho what is talked about in this thread is an onlyif > parameter for > a resource, so unless/onlyif as a metaparameter. Right? > > BUT this won't be something like: > > if File.exist?('/foo/bar') { > package{'foobar': ensure => present } > } > > this will be like: > > package{'foobar': > ensure => installed, > onlyif => 'test -f /foo/bar', > } > > but your were suggesting something like: > > --- quote --- > In pseudo-code: > > if file_exists("/opt/orange_app") { > # file exists, load the module > include orange > }
Yes, you're right, I mistakenly construed that what they were discussing would directly solve my problem, which it wouldn't. It's apples and oranges - both fruits I would enjoy but not the same fruits. > Besides that, if we are talking about onlyif/unless as a > metaparameter: > There have even been recently some work to provide unless > as a > metaparameter. See "possible #651 patch" thread on the > puppet-dev list > and maybe also have a look at bug #651. Ok, I'll check that out. But now I'm confused again... You say that this is possible and may even be implemented soon: package { 'foobar': ensure => installed, onlyif => 'test -f /foo/bar', } But something like this is pretty much out-of-the-question? $foo_exists = client_exec('test -f /foo/bar') if $foo_exists == 0 { # file exists, load the module include foobar } Both scenarios involve a decision based on output from the client. Perhaps I just need to approach it a different way: create a new type and put all my custom logic in there? homemade_application { 'foobar': ensure => installed, onlyif => 'test -f /foo/bar', } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---