From: Peter Palfrader Date: Tue, 23 Dec 2014 12:11:16 +0000 (+0100) Subject: First attempt at making apache conf stuff work on jessie X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=e9682bb9443eb88a18425c2df56aa815d9621948;p=mirror%2Fdsa-puppet.git First attempt at making apache conf stuff work on jessie --- diff --git a/modules/apache2/manifests/config.pp b/modules/apache2/manifests/config.pp index 9a1111501..f44dc019f 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'], } } }