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'],
}
}
}