What I like to do in situations like this:

   service { 'httpd':
     name   => $service_name,
     enable => $service_enable,
   }

   if $service_ensure {
     Service['httpd'] { ensure => $service_ensure }
   }

It looks like an override, but it does work in the same class iff the
respective properties (or parameters) are not yet declared.

Cheers,
Felix

On 01/13/2014 08:01 PM, Jeffrey Lewis wrote:
> For reference, I modified manifests/service.pp to look like this:
> 
>   service { 'httpd':
>     ensure => $service_ensure ? {
>                 ''      => undef,
>                 default => $service_ensure,
>               },
>     name   => $service_name,
>     enable => $service_enable,
>   }

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52DC7E43.5000605%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to