On Monday, January 13, 2014 6:27:17 AM UTC-8, jcbollinger wrote: > All class parameters must have values assigned, whether by explicit > declaration or by default value (or by automated data binding, but that > requires Puppet 3). Undef is not a value. In fact "not a value" is > practically its definition. Declaring a class or resource parameter as > undef is an explicit expression of not assigning a value. >
Right. So, setting "service_ensure => undef" is equivalent to setting nothing, and the module uses the default value for service_ensure (which is 'running'). > Check the module documentation, but it sounds like the stock version does > not support what you want to do. > Agreed. Worse, the documentation states that setting 'service_ensure => undef' should work, but that isn't the case for me, at least in puppet 2.7.11. service_ensure Determines whether the service should be running. Can be set to 'undef' which is useful when you want to let the service be managed by some other application like pacemaker. Defaults to 'running'. > Personally, though, I would look into modifying the module appropriately, > then opening an issue against it and contributing your solution. Perhaps > you could make an empty value of service_ensure suppress managing the run > state of the service. > I ended up using a 'selector' as a ternary operator to do just that. Hopefully my syntax isn't too ugly. I'll see if the puppetlabs folks can accept this upstream. 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, } Thanks, Jefffrey -- 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/14edbaf9-3cd8-43f8-9096-ae6e5cf09ee2%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.