From b732adaa6cd4fbd82eb975a3e12ee24e3b762f35 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 8 Feb 2015 12:29:58 -0500 Subject: [PATCH] split out service so we can use file standalone --- manifests/file.pp | 4 ++++ manifests/init.pp | 11 +++-------- manifests/service.pp | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 manifests/service.pp diff --git a/manifests/file.pp b/manifests/file.pp index 8e1c2a4..52f2d8a 100644 --- a/manifests/file.pp +++ b/manifests/file.pp @@ -35,6 +35,10 @@ $source = undef, $content = undef, ) { + + include ::apache_httpd::install + include ::apache_httpd::service + file { "${confd}/${title}": ensure => $ensure, owner => $owner, diff --git a/manifests/init.pp b/manifests/init.pp index 60fcf72..37a061c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -71,6 +71,9 @@ ) inherits ::apache_httpd::params { include '::apache_httpd::install' + class { '::apache_httpd::service': + service_restart => $service_restart + } # Our own pre-configured file (disable nearly everything) file { '/etc/httpd/conf/httpd.conf': @@ -146,14 +149,6 @@ content => template("${module_name}/logrotate.erb"), } - # Main service - service { 'httpd': - ensure => running, - enable => true, - restart => $service_restart, - hasstatus => true, - require => Package['httpd'], - } if $ssl { package { 'mod_ssl': ensure => installed, diff --git a/manifests/service.pp b/manifests/service.pp new file mode 100644 index 0000000..a26cd58 --- /dev/null +++ b/manifests/service.pp @@ -0,0 +1,19 @@ +# Class: apache_httpd::service +# +# Apache httpd web server service class. +# +class apache_httpd::service ( + $service_restart = $::apache_httpd::params::service_restart, +) { + + include '::apache_httpd::install' + + # Main service + service { 'httpd': + ensure => running, + enable => true, + restart => $service_restart, + hasstatus => true, + require => Package['httpd'], + } +}