Loading manifests/module.pp +7 −7 Original line number Diff line number Diff line # Enable an Apache module. # Enable an Apache module. Meant to be used with the # puppetlabs/apache module. # # This uses the a2enmod tool provided by Debian to enable a module with its # configuration. Example: Loading @@ -7,13 +8,12 @@ # # This infrastructure, and therefore this define, is only available on Debian. define su_apache::module($ensure) { define su_apache::module( Enum ['present', 'absent'] $ensure = undef, ) { if ($::operatingsystem != 'debian') and ($::operatingsystem != 'ubuntu') { fail("Unsupported su_apache::module operating system ${::operatingsystem}") } if !($ensure in [ 'present', 'absent' ]) { fail("ensure must be present or absent, not $ensure") } # Set various local variables to keep the exec readable. $modsdir = '/etc/apache2/mods-enabled' Loading @@ -31,8 +31,8 @@ define su_apache::module($ensure) { exec { $cmd: command => $cmd, path => '/usr/sbin:/usr/bin', require => Package['apache'], require => Class['apache'], unless => "[ $condition ]", notify => Exec['apache reload']; notify => Class['apache::service']; } } manifests/site.pp +10 −9 Original line number Diff line number Diff line # Install an Apache site configuration and enable it. # Install an Apache site configuration and enable it. Meant to be used with the # puppetlabs/apache module. # # This is used for virtual hosts and enables the site with the Apache a2ensite # tool. Examples: Loading Loading @@ -40,7 +41,7 @@ define su_apache::site( ensure => $ensure, source => $source, content => $content, notify => Class['su_apache::service'], notify => Class['apache::service'], } # Enable or disable the site, based on the ensure parameter. Loading @@ -49,16 +50,16 @@ define su_apache::site( command => "a2ensite ${site_id}", path => '/usr/bin:/usr/sbin', creates => "/etc/apache2/sites-enabled/${site_id}", require => [ Class['su_apache'], File[$realname] ], notify => Class['su_apache::service'], require => [ Class['apache'], File[$realname] ], notify => Class['apache::service'], } } elsif ($ensure == 'absent') { exec { "a2dissite ${site_id}": command => "a2dissite ${site_id}", unless => "[ ! -e '/etc/apache2/sites-enabled/${site_id}' ]", path => '/usr/bin:/usr/sbin', require => Class['su_apache'], notify => Class['su_apache::service'], require => Class['apache'], notify => Class['apache::service'], } } } Loading
manifests/module.pp +7 −7 Original line number Diff line number Diff line # Enable an Apache module. # Enable an Apache module. Meant to be used with the # puppetlabs/apache module. # # This uses the a2enmod tool provided by Debian to enable a module with its # configuration. Example: Loading @@ -7,13 +8,12 @@ # # This infrastructure, and therefore this define, is only available on Debian. define su_apache::module($ensure) { define su_apache::module( Enum ['present', 'absent'] $ensure = undef, ) { if ($::operatingsystem != 'debian') and ($::operatingsystem != 'ubuntu') { fail("Unsupported su_apache::module operating system ${::operatingsystem}") } if !($ensure in [ 'present', 'absent' ]) { fail("ensure must be present or absent, not $ensure") } # Set various local variables to keep the exec readable. $modsdir = '/etc/apache2/mods-enabled' Loading @@ -31,8 +31,8 @@ define su_apache::module($ensure) { exec { $cmd: command => $cmd, path => '/usr/sbin:/usr/bin', require => Package['apache'], require => Class['apache'], unless => "[ $condition ]", notify => Exec['apache reload']; notify => Class['apache::service']; } }
manifests/site.pp +10 −9 Original line number Diff line number Diff line # Install an Apache site configuration and enable it. # Install an Apache site configuration and enable it. Meant to be used with the # puppetlabs/apache module. # # This is used for virtual hosts and enables the site with the Apache a2ensite # tool. Examples: Loading Loading @@ -40,7 +41,7 @@ define su_apache::site( ensure => $ensure, source => $source, content => $content, notify => Class['su_apache::service'], notify => Class['apache::service'], } # Enable or disable the site, based on the ensure parameter. Loading @@ -49,16 +50,16 @@ define su_apache::site( command => "a2ensite ${site_id}", path => '/usr/bin:/usr/sbin', creates => "/etc/apache2/sites-enabled/${site_id}", require => [ Class['su_apache'], File[$realname] ], notify => Class['su_apache::service'], require => [ Class['apache'], File[$realname] ], notify => Class['apache::service'], } } elsif ($ensure == 'absent') { exec { "a2dissite ${site_id}": command => "a2dissite ${site_id}", unless => "[ ! -e '/etc/apache2/sites-enabled/${site_id}' ]", path => '/usr/bin:/usr/sbin', require => Class['su_apache'], notify => Class['su_apache::service'], require => Class['apache'], notify => Class['apache::service'], } } }