From e9682bb9443eb88a18425c2df56aa815d9621948 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 23 Dec 2014 13:11:16 +0100 Subject: [PATCH] First attempt at making apache conf stuff work on jessie --- modules/apache2/manifests/config.pp | 51 ++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/modules/apache2/manifests/config.pp b/modules/apache2/manifests/config.pp index 9a111150..f44dc019 100644 --- a/modules/apache2/manifests/config.pp +++ b/modules/apache2/manifests/config.pp @@ -16,19 +16,48 @@ define apache2::config ( default: { fail ( "Unknown ensure value: '$ensure'" ) } } - if $content { - file { "/etc/apache2/conf.d/${name}": - ensure => $ensure, - content => $content, - require => Package['apache2'], - notify => Service['apache2'], + if $::lsbmajdistrelease <= 7 { + if $content { + file { "/etc/apache2/conf.d/${name}": + ensure => $ensure, + content => $content, + require => Package['apache2'], + notify => Service['apache2'], + } + } else { + file { "/etc/apache2/conf.d/${name}": + ensure => $ensure, + source => $source, + require => Package['apache2'], + notify => Service['apache2'], + } } } else { - file { "/etc/apache2/conf.d/${name}": - ensure => $ensure, - source => $source, - require => Package['apache2'], - notify => Service['apache2'], + if $content { + file { "/etc/apache2/conf-available/${name}.conf": + ensure => $ensure, + content => $content, + require => Package['apache2'], + notify => Service['apache2'], + } + } else { + file { "/etc/apache2/conf-available/${name}.conf": + ensure => $ensure, + source => $source, + require => Package['apache2'], + notify => Service['apache2'], + } + } + + $link_ensure = $ensure == present ? { + present => 'link', + absent => 'absent' + } + + file { "/etc/apache2/conf-enabled/${name}": + ensure => $link_ensure, + target => "/etc/apache2/conf-available/${base}.conf", + notify => Service['apache2'], } } } -- 2.39.2