projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make 192 the new default
[mirror/dsa-puppet.git]
/
modules
/
apache2
/
manifests
/
site.pp
diff --git
a/modules/apache2/manifests/site.pp
b/modules/apache2/manifests/site.pp
index
7acbfc6
..
46ec1bf
100644
(file)
--- a/
modules/apache2/manifests/site.pp
+++ b/
modules/apache2/manifests/site.pp
@@
-1,6
+1,6
@@
define apache2::site (
$source=undef,
define apache2::site (
$source=undef,
- $content=
false
,
+ $content=
undef
,
$ensure=present,
$site=undef
) {
$ensure=present,
$site=undef
) {
@@
-27,8
+27,7
@@
define apache2::site (
$link_target = $ensure ? {
present => $target,
$link_target = $ensure ? {
present => $target,
- absent => absent,
- default => fail ( "Unknown ensure value: '$ensure'" ),
+ absent => absent
}
if $content {
}
if $content {
@@
-47,14
+46,25
@@
define apache2::site (
}
}
}
}
- if $ensure == present {
+ if $::lsbmajdistrelease <= 7 {
+ $symlink = "/etc/apache2/sites-enabled/${name}"
+ } else {
+ $symlink = "/etc/apache2/sites-enabled/${name}.conf"
+
file { "/etc/apache2/sites-enabled/${name}":
file { "/etc/apache2/sites-enabled/${name}":
+ ensure => absent,
+ notify => Service['apache2'],
+ }
+ }
+
+ if $ensure == present {
+ file { $symlink:
ensure => link,
target => $link_target,
notify => Service['apache2'],
}
} else {
ensure => link,
target => $link_target,
notify => Service['apache2'],
}
} else {
- file {
"/etc/apache2/sites-enabled/${name}"
:
+ file {
$symlink
:
ensure => absent,
notify => Service['apache2'],
}
ensure => absent,
notify => Service['apache2'],
}