1 # Install and enable an apache site
3 # @param source source of the apache vhost file
4 # @param content content of the apache vhost file
5 # @param ensure present or absent
6 # @param site site name
8 Optional[String] $source = undef,
9 Optional[String] $content = undef,
10 Enum['present','absent'] $ensure = 'present',
15 if $ensure == 'present' {
16 if ! ($source or $content) {
17 fail ( "No configuration (source or content) found for ${name}" )
21 $target = "/etc/apache2/sites-available/${site}"
22 $symlink = "/etc/apache2/sites-enabled/${name}.conf"
23 $link_ensure = $ensure ? {
32 require => Package['apache2'],
33 notify => Exec['service apache2 reload'],
36 ensure => $link_ensure,
38 notify => Exec['service apache2 reload'],