diff options
author | mh <mh@immerda.ch> | 2011-11-22 23:57:55 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-11-22 23:57:55 +0100 |
commit | d186ff759ee7e122a7767ce7e8c50f86cd6a2c9e (patch) | |
tree | de8c20122629b276d8427b347bc355d0e85107cb | |
parent | 3b1eaddf445f00162b9f58bf83bd0bff772564df (diff) |
as file_line lacks ensure => absent, we have to do it with a sed
-rw-r--r-- | manifests/centos.pp | 20 | ||||
-rw-r--r-- | manifests/centos/itk_plus.pp | 9 |
2 files changed, 18 insertions, 11 deletions
diff --git a/manifests/centos.pp b/manifests/centos.pp index ccbc079..95d06ce 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -38,18 +38,20 @@ class apache::centos inherits apache::package { owner => root, group => 0, mode => 0644; } - file_line{ - 'pidfile_httpd.conf': - path => '/etc/httpd/conf/httpd.conf', - line => 'PidFile run/httpd.pid', + # this is for later fixes + exec{ + 'adjust_pidfile': + command => 'sed -i "s/^#PidFile \(.*\)/PidFile \1/g" /etc/httpd/conf/httpd.conf', + unless => "grep -qE '^PidFile ' /etc/httpd/conf/httpd.conf", require => Package['apache'], - notify=> Service['apache']; - 'listen_httpd.conf': - path => '/etc/httpd/conf/httpd.conf', - line => 'Listen 80', + notify => Service['apache']; + 'adjust_listen': + command => 'sed -i "s/^#Listen \(.*\)/Listen \1/g" /etc/httpd/conf/httpd.conf', + unless => "grep -qE '^Listen ' /etc/httpd/conf/httpd.conf", require => Package['apache'], - notify=> Service['apache']; + notify => Service['apache']; } + apache::config::global{'00-listen.conf': ensure => absent, } diff --git a/manifests/centos/itk_plus.pp b/manifests/centos/itk_plus.pp index c034e8b..9bcd8ca 100644 --- a/manifests/centos/itk_plus.pp +++ b/manifests/centos/itk_plus.pp @@ -1,7 +1,12 @@ # http://hostby.net/home/2008/07/12/centos-5-and-mpm-itk/ class apache::centos::itk_plus inherits apache::centos::itk { - File_line['pidfile_httpd.conf','listen_httpd.conf']{ - ensure => absent, + Exec['adjust_pidfile']{ + command => "sed -i 's/^PidFile \(.*\)/#PidFile \1/g' /etc/httpd/conf/httpd.conf", + unless => "grep -qE '^#PidFile ' /etc/httpd/conf/httpd.conf", + } + Exec['adjust_listen']{ + command => "sed -i 's/^Listen \(.*\)/#Listen \1/g' /etc/httpd/conf/httpd.conf", + unless => "grep -qE '^#Listen ' /etc/httpd/conf/httpd.conf", } Apache::Config::Global['00-listen.conf']{ |