Browse files

Merge pull request #108 from rwstauner/service_enable

Accept service_enable parameter to install without running at boot
  • Loading branch information...
2 parents c482968 + ce2d277 commit eee642ff831a38d2de93884d1be40496cf1502e4 @hunner hunner committed Nov 11, 2012
Showing with 8 additions and 4 deletions.
  1. +6 −2 manifests/init.pp
  2. +2 −2 spec/classes/apache_spec.rb
View
8 manifests/init.pp
@@ -14,6 +14,7 @@
#
class apache (
$default_mods = true,
+ $service_enable = true,
$serveradmin = 'root@localhost',
$sendfile = false
) {
@@ -24,10 +25,13 @@
name => $apache::params::apache_name,
}
+ # true/false is sufficient for both ensure and enable
+ validate_bool($service_enable)
+
service { 'httpd':
- ensure => running,
+ ensure => $service_enable,
name => $apache::params::apache_name,
- enable => true,
+ enable => $service_enable,
subscribe => Package['httpd'],
}
View
4 spec/classes/apache_spec.rb
@@ -8,7 +8,7 @@
it { should include_class("apache::params") }
it { should contain_package("httpd") }
it { should contain_service("httpd").with(
- 'ensure' => 'running',
+ 'ensure' => 'true',
'enable' => 'true',
'subscribe' => 'Package[httpd]'
)
@@ -29,7 +29,7 @@
it { should include_class("apache::params") }
it { should contain_package("httpd") }
it { should contain_service("httpd").with(
- 'ensure' => 'running',
+ 'ensure' => 'true',
'enable' => 'true',
'subscribe' => 'Package[httpd]'
)

0 comments on commit eee642f

Please sign in to comment.