summaryrefslogtreecommitdiff
path: root/manifests/site.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/site.pp')
-rw-r--r--manifests/site.pp48
1 files changed, 7 insertions, 41 deletions
diff --git a/manifests/site.pp b/manifests/site.pp
index 8bb878c..ccde244 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -122,47 +122,13 @@ define apache::site(
ensure => absent,
}
- case $source {
- true: {
- file { "${apache::conf_sites}-available/$vhost.conf":
- ensure => $ensure,
- source => [ "puppet:///modules/site_apache/vhosts/$domain/${name}",
- "puppet:///modules/site_apache/vhosts/${name}" ],
- owner => root,
- group => root,
- mode => 0644,
- require => File["${apache::macros}"],
- notify => Service["apache"],
- }
- }
- false: {
- file { "${apache::conf_sites}-available/$vhost.conf":
- ensure => $ensure,
- content => template("$template"),
- owner => root,
- group => root,
- mode => 0644,
- require => File["${apache::macros}"],
- notify => Service["apache"],
- }
- }
+ apache::site::config { $name:
+ ensure => $ensure,
+ source => $source,
+ vhost => $vhost,
+ template => $template,
}
- # Enable the site without a2ensite
- #
- #$status = $ensure ? {
- # 'present' => "${apache::conf_sites}-available/$vhost.conf",
- # default => 'absent',
- #}
- #
- #file { "/etc/apache2/sites-enabled/$vhost.conf":
- # ensure => $status,
- # owner => root,
- # group => root,
- # require => File["${apache::conf_sites}-available/${name}"],
- # notify => Service["apache"],
- #}
-
case $ensure {
'present': {
if ($docroot != false) and ($manage_docroot == true) {
@@ -192,7 +158,7 @@ define apache::site(
},
unless => "/bin/sh -c '[ -L ${apache::conf_sites}-enabled/$vhost.conf ] \
&& [ ${apache::conf_sites}-enabled/$vhost.conf -ef ${apache::conf_sites}-available/$vhost.conf ]'",
- require => File["${apache::conf_sites}-available/$vhost.conf"],
+ require => Apache::Site::Config[$name],
notify => Exec["reload-apache2"],
}
}
@@ -204,7 +170,7 @@ define apache::site(
},
onlyif => "/bin/sh -c '[ -L ${apache::conf_sites}-enabled/$vhost.conf ] \
&& [ ${apache::conf_sites}-enabled/$vhost.conf -ef ${apache::conf_sites}-available/$vhost.conf ]'",
- require => File["${apache::conf_sites}-available/$vhost.conf"],
+ require => Apache::Site::Config[$name],
notify => Exec["reload-apache2"],
}