summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-11-01 13:58:09 +0000
committermh <mh@immerda.ch>2008-11-01 13:58:09 +0000
commit70127d1200afb6903dac64b4ac3ebf51712bbb3d (patch)
tree578c00ca126ed21d3e7c2c08106665d01d4d8d68
parent7a0ddd2fd2b3c4f32bbe418818f4e6ad948d2b95 (diff)
enabled apache for openbsd
-rw-r--r--files/openbsd/bin/restart_apache.sh6
-rw-r--r--files/openbsd/bin/restart_apache_ssl.sh6
-rw-r--r--manifests/init.pp15
-rw-r--r--manifests/ssl.pp10
4 files changed, 37 insertions, 0 deletions
diff --git a/files/openbsd/bin/restart_apache.sh b/files/openbsd/bin/restart_apache.sh
new file mode 100644
index 0000000..e12bd29
--- /dev/null
+++ b/files/openbsd/bin/restart_apache.sh
@@ -0,0 +1,6 @@
+#!/usr/local/bin/bash
+
+ignoreout='Processing config'
+apachectl restart 2>&1 | (egrep -v -e "_default_ VirtualHost overlap on port 443" -e "$ignoreout" -e "/usr/sbin/apachectl restart: httpd restarted" || true )
+sleep 10
+apachectl start 2>&1 | (egrep -v -e "_default_ VirtualHost overlap on port 443" -e "$ignoreout" -e "/usr/sbin/apachectl startssl: httpd started" || true )
diff --git a/files/openbsd/bin/restart_apache_ssl.sh b/files/openbsd/bin/restart_apache_ssl.sh
new file mode 100644
index 0000000..a54f28f
--- /dev/null
+++ b/files/openbsd/bin/restart_apache_ssl.sh
@@ -0,0 +1,6 @@
+#!/usr/local/bin/bash
+
+ignoreout='Processing config'
+apachectl restart 2>&1 | (egrep -v -e "_default_ VirtualHost overlap on port 443" -e "$ignoreout" -e "/usr/sbin/apachectl restart: httpd restarted" || true )
+sleep 10
+apachectl startssl 2>&1 | (egrep -v -e "_default_ VirtualHost overlap on port 443" -e "$ignoreout" -e "/usr/sbin/apachectl startssl: httpd started" || true )
diff --git a/manifests/init.pp b/manifests/init.pp
index db77b14..2fccd4d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -165,4 +165,19 @@ class apache::openbsd inherits apache::base {
File[default_apache_index] {
path => '/var/www/htdocs/index.html',
}
+
+ file{'/opt/bin/restart_apache.sh':
+ source => "puppet://$server/apache/openbsd/bin/restart_apache.sh",
+ require => File['/opt/bin'],
+ owner => root, group => 0, mode => 0700;
+ }
+
+ Service['apache']{
+ hasstatus => true,
+ hasrestart => true,
+ restart => '/opt/bin/restart_apache.sh',
+ status => 'apachectl status',
+ start => 'apachectl start',
+ stop => 'apachectl stop',
+ }
}
diff --git a/manifests/ssl.pp b/manifests/ssl.pp
index 32e7b34..eeee243 100644
--- a/manifests/ssl.pp
+++ b/manifests/ssl.pp
@@ -4,6 +4,7 @@ class apache::ssl inherits apache {
case $operatingsystem {
centos: { include apache::ssl::centos }
gentoo: { include apache::ssl::gentoo }
+ openbsd: { include apache::ssl::openbsd }
defaults: { include apache::ssl::base }
}
}
@@ -31,3 +32,12 @@ class apache::ssl::gentoo inherits apache::ssl::base {
apache::module::file { '00_error_documents': }
apache::vhost::file { '00_default_ssl_vhost': }
}
+
+class apache::ssl::openbsd inherits apache::openbsd {
+ File['/opt/bin/restart_apache.sh']{
+ source => "puppet://$server/apache/openbsd/bin/restart_apache_ssl.sh",
+ }
+ Service['apache']{
+ start => 'apachectl startssl',
+ }
+}