This is working for me:

  if ! defined(Class['ops_logging']) {
    class { 'ops_logging':
      collectives   => $collectives,
      middleware    => $rabbithost,
      metrics       => $metrics,
      configuration => $configuration,
      monitor       => $monitor,
    }
  }


Op woensdag 1 april 2015 20:35:06 UTC+2 schreef guymatz:
>
> I've seen some folks say this should work:
>
> if defined(::class::subclass)
>
> but it doesn't seem to work for me.  Again, any thoughts would be greatly 
> appreciated!
>
> Regards,
> Guy
>
> On Wed, Apr 1, 2015 at 11:26 AM, Guy Matz <[email protected] <javascript:>> 
> wrote:
>
>> Hi!  I have a process that is controlled by daemontools on some servers, 
>> and by init on other (i know, i know) and I need a way to have a Service 
>> definition when daemontools is not in the run.  
>>
>> I've tried this:
>>   unless defined(Class['daemontools']) {
>>     notify { 'I Do not see daemontools': }
>>     service { $dw_service:
>>       ensure    => 'running'
>>     }
>>   }
>>
>> but that didn't work.  I've also tried Class['Daemontools'].
>>
>> Daemontools is the module being used, but it's a actually a subclass, 
>> daemontools::service, that's being called . . . 
>> So I've also tried Class['daemontools::service'] as well as 
>> Class['Daemontools::Service'].  I've tried Class['::Daemontools::Service'], 
>> which didn't work either.
>>
>> I added a notify in daemontools::service which gave me this:
>> Notice: 
>> /Stage[main]/Profiles::Dropwizard::Booker-integration/Daemontools::Service[booker-integration]/Notify[Here
>>  
>> I am!!]/message: defined 'message' as 'Here I am!!'
>>
>> So I also tried "unless 
>> defined(Class['Daemontools::Service[booker-integration]']), which, of 
>> course, did not work.
>>
>> Anyone know what I need to get the "unless" to catch whether I am using 
>> daemontools::service?  And even better, doers anyone know how I could have 
>> debugged this to find this out for myself?
>>
>> Thanks so much!
>> Guy
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/99788530-31bd-455f-b2e4-8801982cd09b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to