summaryrefslogtreecommitdiff
path: root/manifests/vhost/redirect.pp
diff options
context:
space:
mode:
authorng <ng@acabyte.ath.cx>2009-08-17 19:14:59 +0200
committerng <ng@acabyte.ath.cx>2009-08-17 19:19:38 +0200
commitdf8ecc11ede7c04d9b0ced49fb7785ceb8d281cc (patch)
tree98fa757b4cc6417e6f34191e5e69092d17f5ce13 /manifests/vhost/redirect.pp
parent5260ec75476a03b273db1fb26a43a1234d8c1d9e (diff)
added a redirect vhost define
Diffstat (limited to 'manifests/vhost/redirect.pp')
-rw-r--r--manifests/vhost/redirect.pp37
1 files changed, 37 insertions, 0 deletions
diff --git a/manifests/vhost/redirect.pp b/manifests/vhost/redirect.pp
new file mode 100644
index 0000000..64ebaec
--- /dev/null
+++ b/manifests/vhost/redirect.pp
@@ -0,0 +1,37 @@
+# Redirect VHost to redirect hosts
+# Parameters:
+# - ensure: wether this vhost is `present` or `absent`
+# - domain: the domain to redirect (*name*)
+# - domainalias: A list of whitespace seperated domains to redirect
+# - target_url: the url to redirect to. Note: We don't want http://example.com/foobar only example.com/foobar
+# - server_admin: the email that is shown as responsible
+# - ssl_mode: wether this vhost supports ssl or not
+# - false: don't enable ssl for this vhost (default)
+# - true: enable ssl for this vhost
+# - force: enable ssl and redirect non-ssl to ssl
+# - only: enable ssl only
+# - vhost_destination: where to put the vhost
+define apache::vhost::redirect(
+ $ensure = present,
+ $domain = 'absent',
+ $domainalias = 'absent',
+ $target_url,
+ $server_admin = 'absent',
+ $ssl_mode = false,
+ $vhost_destination = 'absent'
+){
+ # create vhost configuration file
+ # we use the options field as the target_url
+ ::apache::vhost::template{$name:
+ ensure => $ensure,
+ template_mode => 'redirect',
+ domain => $domain,
+ domainalias => $domainalias,
+ server_admin => $server_admin,
+ allow_override => $allow_override,
+ options => $target_url,
+ ssl_mode => $ssl_mode,
+ vhost_destination => $vhost_destination,
+ }
+}
+