aboutsummaryrefslogtreecommitdiffstats
path: root/modules/apache/manifests/vhost
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-25 12:47:17 +0000
committerMichael Scherer <misc@mageia.org>2012-03-25 12:47:17 +0000
commite8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f (patch)
treea591c18ee460f34fc9740385521db84aba53a92a /modules/apache/manifests/vhost
parentc955e02a3b930b81092d182633b7830735211250 (diff)
downloadpuppet-e8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f.tar
puppet-e8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f.tar.gz
puppet-e8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f.tar.bz2
puppet-e8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f.tar.xz
puppet-e8a1c18d0fadfbfef7e5ddcd8eab19bfab031f8f.zip
split apache::vhost_base in apache::vhost::base ( in a subdirecotry, to not have too much file on manifests/
Diffstat (limited to 'modules/apache/manifests/vhost')
-rw-r--r--modules/apache/manifests/vhost/base.pp50
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/apache/manifests/vhost/base.pp b/modules/apache/manifests/vhost/base.pp
new file mode 100644
index 00000000..c4bd1f91
--- /dev/null
+++ b/modules/apache/manifests/vhost/base.pp
@@ -0,0 +1,50 @@
+define apache::vhost::base ($content = '',
+ $location = '/dev/null',
+ $use_ssl = false,
+ $vhost = false,
+ $aliases = {},
+ $server_aliases = [],
+ $access_logfile = false,
+ $error_logfile = false,
+ $options = [],
+ $enable_public_html = false) {
+ include apache::base
+ $httpd_logdir = '/var/log/httpd'
+ $filename = "$name.conf"
+
+ if ! $vhost {
+ $real_vhost = $name
+ } else {
+ $real_vhost = $vhost
+ }
+
+ if ! $access_logfile {
+ $real_access_logfile = "$httpd_logdir/${real_vhost}-access_log"
+ } else {
+ $real_access_logfile = $access_logfile
+ }
+ if ! $error_logfile {
+ $real_error_logfile = "$httpd_logdir/${real_vhost}-error_log"
+ } else {
+ $real_error_logfile = $error_logfile
+ }
+
+ if $use_ssl {
+ include apache::mod::ssl
+ if $wildcard_sslcert != true {
+ openssl::self_signed_cert{ $real_vhost:
+ directory => '/etc/ssl/apache/',
+ before => Apache::Config["/etc/httpd/conf/vhosts.d/$filename"],
+ }
+ }
+ }
+
+ if $enable_public_html {
+ include apache::mod::public_html
+ }
+
+ apache::config { "/etc/httpd/conf/vhosts.d/$filename":
+ content => template('apache/vhost_base.conf')
+ }
+ }
+}