diff --git a/manifests/service.pp b/manifests/service.pp index 2818532..2fa361c 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -23,11 +23,18 @@ class nginx::service( running => true, absent => false, stopped => false, + 'undef' => undef, default => true, } + if $service_ensure == 'undef' { + $service_ensure_real = undef + } else { + $service_ensure_real = $service_ensure + } + service { 'nginx': - ensure => $service_ensure, + ensure => $service_ensure_real, enable => $service_enable, hasstatus => true, hasrestart => true,