case $source {
true: {
- file { "${apache::sites}-available/$vhost":
+ file { "${apache::sites}-available/$vhost.conf":
ensure => $ensure,
source => [ "puppet:///modules/site_apache/vhosts/$domain/$title",
"puppet:///modules/site_apache/vhosts/$title" ],
}
}
false: {
- file { "${apache::sites}-available/$vhost":
+ file { "${apache::sites}-available/$vhost.conf":
ensure => $ensure,
content => template("$template"),
owner => root,
}
}
exec { "/usr/sbin/a2ensite $vhost":
- unless => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost ] \
- && [ ${apache::sites}-enabled/$vhost -ef ${apache::sites}-available/$vhost ]'",
+ unless => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost.conf ] \
+ && [ ${apache::sites}-enabled/$vhost.conf -ef ${apache::sites}-available/$vhost.conf ]'",
notify => Exec["reload-apache2"],
}
}
'absent': {
exec { "/usr/sbin/a2dissite $vhost":
- onlyif => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost ] \
- && [ ${apache::sites}-enabled/$vhost -ef ${apache::sites}-available/$vhost ]'",
+ onlyif => "/bin/sh -c '[ -L ${apache::sites}-enabled/$vhost.conf ] \
+ && [ ${apache::sites}-enabled/$vhost.conf -ef ${apache::sites}-available/$vhost.conf ]'",
notify => Exec["reload-apache2"],
}
- file { "${apache::sites}-enabled/$vhost":
+ file { "${apache::sites}-enabled/$vhost.conf":
ensure => absent,
notify => Exec["reload-apache2"],
}