Permalink
Browse files

Simplify ensure and enable by using bool for both

Thanks for the tip, Hunter Haugen!
  • Loading branch information...
rwstauner committed Nov 9, 2012
1 parent d0a51ad commit 4065eb5a435bd7b460d501b686972ac27d2172dd
Showing with 2 additions and 7 deletions.
  1. +2 −7 manifests/init.pp
View
@@ -25,16 +25,11 @@
name => $apache::params::apache_name,
}
+ # true/false is sufficient for both ensure and enable
validate_bool($service_enable)
- if $service_enable {
- $service_ensure = 'running'
- }
- else {
- $service_ensure = 'stopped'
- }
service { 'httpd':
- ensure => $service_ensure,
+ ensure => $service_enable,
name => $apache::params::apache_name,
enable => $service_enable,
subscribe => Package['httpd'],

0 comments on commit 4065eb5

Please sign in to comment.