1 # Install and enable (or disable) an apache config snippet
3 # @param source source of the apache conf file
4 # @param content content of the apache conf file
5 # @param ensure present or absent
6 define apache2::config (
7 Optional[String] $source = undef,
8 Optional[String] $content = undef,
9 Enum['present','absent'] $ensure = 'present',
15 if ! ($source or $content) {
16 fail ( "No configuration found for ${name}" )
20 default: { fail ( "Unknown ensure value: ${ensure}" ) }
23 file { "/etc/apache2/conf-available/${name}.conf":
27 require => Package['apache2'],
28 notify => Exec['service apache2 reload'],
31 $link_ensure = $ensure ? {
36 file { "/etc/apache2/conf-enabled/${name}.conf":
37 ensure => $link_ensure,
38 target => "../conf-available/${name}.conf",
39 notify => Exec['service apache2 reload'],