whitespace: apache2/manifests
authorPeter Palfrader <peter@palfrader.org>
Mon, 21 Oct 2019 09:19:55 +0000 (11:19 +0200)
committerPeter Palfrader <peter@palfrader.org>
Mon, 21 Oct 2019 09:28:03 +0000 (11:28 +0200)
modules/apache2/manifests/config.pp
modules/apache2/manifests/module.pp
modules/apache2/manifests/site.pp

index 13697cb..a3bacd9 100644 (file)
@@ -1,51 +1,51 @@
 define apache2::config (
-       $source=undef,
-       $content=undef,
-       $nocontentok=undef,
-       $ensure=present
+  $source=undef,
+  $content=undef,
+  $nocontentok=undef,
+  $ensure=present
 ) {
 
-       include apache2
+  include apache2
 
-       case $ensure {
-               present: {
-                       if ! ($source or $content or $nocontentok) {
-                               fail ( "No configuration found for ${name}" )
-                       }
+  case $ensure {
+    present: {
+      if ! ($source or $content or $nocontentok) {
+        fail ( "No configuration found for ${name}" )
+      }
 
-                       if $content {
-                               file { "/etc/apache2/conf-available/${name}.conf":
-                                       ensure  => $ensure,
-                                       content => $content,
-                                       require => Package['apache2'],
-                                       notify  => Exec['service apache2 reload'],
-                               }
-                       } elsif $source {
-                               file { "/etc/apache2/conf-available/${name}.conf":
-                                       ensure  => $ensure,
-                                       source  => $source,
-                                       require => Package['apache2'],
-                                       notify  => Exec['service apache2 reload'],
-                               }
-                       }
-               }
-               absent:  {
-                       file { "/etc/apache2/conf-available/${name}.conf":
-                               ensure  => $ensure,
-                               require => Package['apache2'],
-                               notify  => Exec['service apache2 reload'],
-                       }
-               }
-               default: { fail ( "Unknown ensure value: '$ensure'" ) }
-       }
-       $link_ensure = $ensure ? {
-               present => link,
-               absent  => absent
-       }
+      if $content {
+        file { "/etc/apache2/conf-available/${name}.conf":
+          ensure  => $ensure,
+          content => $content,
+          require => Package['apache2'],
+          notify  => Exec['service apache2 reload'],
+        }
+      } elsif $source {
+        file { "/etc/apache2/conf-available/${name}.conf":
+          ensure  => $ensure,
+          source  => $source,
+          require => Package['apache2'],
+          notify  => Exec['service apache2 reload'],
+        }
+      }
+    }
+    absent:  {
+      file { "/etc/apache2/conf-available/${name}.conf":
+        ensure  => $ensure,
+        require => Package['apache2'],
+        notify  => Exec['service apache2 reload'],
+      }
+    }
+    default: { fail ( "Unknown ensure value: '$ensure'" ) }
+  }
+  $link_ensure = $ensure ? {
+    present => link,
+    absent  => absent
+  }
 
-       file { "/etc/apache2/conf-enabled/${name}.conf":
-               ensure => $link_ensure,
-               target => "../conf-available/${name}.conf",
-               notify  => Exec['service apache2 reload'],
-       }
+  file { "/etc/apache2/conf-enabled/${name}.conf":
+    ensure => $link_ensure,
+    target => "../conf-available/${name}.conf",
+    notify  => Exec['service apache2 reload'],
+  }
 }
index ff26ea6..3862353 100644 (file)
@@ -1,19 +1,19 @@
 define apache2::module ($ensure = present) {
-       case $ensure {
-               present: {
-                       exec { "/usr/sbin/a2enmod ${name}":
-                               creates => "/etc/apache2/mods-enabled/${name}.load",
-                               require => Package['apache2'],
-                               notify  => Service['apache2']
-                       }
-               }
-               absent: {
-                       exec { "/usr/sbin/a2dismod ${name}":
-                               onlyif  => "test -L /etc/apache2/mods-enabled/${name}.load",
-                               require => Package['apache2'],
-                               notify  => Service['apache2']
-                       }
-               }
-               default: { fail ( "Unknown ensure value: '$ensure'" ) }
-       }
+  case $ensure {
+    present: {
+      exec { "/usr/sbin/a2enmod ${name}":
+        creates => "/etc/apache2/mods-enabled/${name}.load",
+        require => Package['apache2'],
+        notify  => Service['apache2']
+      }
+    }
+    absent: {
+      exec { "/usr/sbin/a2dismod ${name}":
+        onlyif  => "test -L /etc/apache2/mods-enabled/${name}.load",
+        require => Package['apache2'],
+        notify  => Service['apache2']
+      }
+    }
+    default: { fail ( "Unknown ensure value: '$ensure'" ) }
+  }
 }
index dc9b1ce..1a71e09 100644 (file)
@@ -1,68 +1,68 @@
 define apache2::site (
-       $source=undef,
-       $content=undef,
-       $ensure=present,
-       $site=undef
+  $source=undef,
+  $content=undef,
+  $ensure=present,
+  $site=undef
 ) {
 
-       include apache2
+  include apache2
 
-       case $ensure {
-               present: {
-                       if ! ($source or $content) {
-                               fail ( "No configuration found for ${name}" )
-                       }
-               }
-               absent:  {}
-               default: { fail ( "Unknown ensure value: '$ensure'" ) }
-       }
+  case $ensure {
+    present: {
+      if ! ($source or $content) {
+        fail ( "No configuration found for ${name}" )
+      }
+    }
+    absent:  {}
+    default: { fail ( "Unknown ensure value: '$ensure'" ) }
+  }
 
-       if $site {
-               $base = $site
-       } else {
-               $base = $name
-       }
+  if $site {
+    $base = $site
+  } else {
+    $base = $name
+  }
 
-       $target = "/etc/apache2/sites-available/${base}"
+  $target = "/etc/apache2/sites-available/${base}"
 
-       $link_target = $ensure ? {
-               present => $target,
-               absent  => absent
-       }
+  $link_target = $ensure ? {
+    present => $target,
+    absent  => absent
+  }
 
-       if $content {
-               file { $target:
-                       ensure  => $ensure,
-                       content => $content,
-                       require => Package['apache2'],
-                       notify  => Exec['service apache2 reload'],
-               }
-       } else {
-               file { $target:
-                       ensure  => $ensure,
-                       source  => $source,
-                       require => Package['apache2'],
-                       notify  => Exec['service apache2 reload'],
-               }
-       }
+  if $content {
+    file { $target:
+      ensure  => $ensure,
+      content => $content,
+      require => Package['apache2'],
+      notify  => Exec['service apache2 reload'],
+    }
+  } else {
+    file { $target:
+      ensure  => $ensure,
+      source  => $source,
+      require => Package['apache2'],
+      notify  => Exec['service apache2 reload'],
+    }
+  }
 
-       $symlink = "/etc/apache2/sites-enabled/${name}.conf"
+  $symlink = "/etc/apache2/sites-enabled/${name}.conf"
 
-       file { "/etc/apache2/sites-enabled/${name}":
-               ensure => absent,
-               notify  => Exec['service apache2 reload'],
-       }
+  file { "/etc/apache2/sites-enabled/${name}":
+    ensure => absent,
+    notify  => Exec['service apache2 reload'],
+  }
 
-       if $ensure == present {
-               file { $symlink:
-                       ensure => link,
-                       target => $link_target,
-                       notify  => Exec['service apache2 reload'],
-               }
-       } else {
-               file { $symlink:
-                       ensure => absent,
-                       notify  => Exec['service apache2 reload'],
-               }
-       }
+  if $ensure == present {
+    file { $symlink:
+      ensure => link,
+      target => $link_target,
+      notify  => Exec['service apache2 reload'],
+    }
+  } else {
+    file { $symlink:
+      ensure => absent,
+      notify  => Exec['service apache2 reload'],
+    }
+  }
 }