Browse Source

Order of the classes parameters is refactored

Order and intendation of those parameters are changed
to follow Puppet Style Guide recommendation [0].
Moreover, it will allow to an user to find much faster
a variable in a list of variables.

[0]. https://docs.puppetlabs.com/guides/style_guide.html

Change-Id: If2443cbc57671784cfcb31bbe0ada0c09f78c996
Andrey Nikitin 3 years ago
parent
commit
080f4bab6a
4 changed files with 29 additions and 29 deletions
  1. 5
    5
      manifests/logrotate.pp
  2. 7
    7
      manifests/params.pp
  3. 9
    9
      manifests/vhost.pp
  4. 8
    8
      manifests/vhost/proxy.pp

+ 5
- 5
manifests/logrotate.pp View File

@@ -1,7 +1,9 @@
1 1
 # == Class: httpd::logrotate
2 2
 #
3 3
 class httpd::logrotate (
4
-  $options = [
4
+  $firstaction = 'undef',
5
+  $lastaction  = 'undef',
6
+  $options     = [
5 7
       'daily',
6 8
       'missingok',
7 9
       'rotate 30',
@@ -10,16 +12,14 @@ class httpd::logrotate (
10 12
       'notifempty',
11 13
       'create 640 root adm',
12 14
   ],
13
-  $prerotate = [
15
+  $prerotate   = [
14 16
     "if [ -d /etc/logrotate.d/${::httpd::params::apache_name}-prerotate ]; then \\",
15 17
     "  run-parts /etc/logrotate.d/${::httpd::params::apache_name}-prerotate; fi ; \\",
16 18
   ],
17
-  $postrotate = [
19
+  $postrotate  = [
18 20
     "if service ${::httpd::params::apache_name} status > /dev/null; then \\",
19 21
     "  service ${::httpd::params::apache_name} reload > /dev/null; fi; \\",
20 22
   ],
21
-  $firstaction = 'undef',
22
-  $lastaction = 'undef',
23 23
 ) inherits httpd::params {
24 24
   include ::logrotate
25 25
 

+ 7
- 7
manifests/params.pp View File

@@ -19,16 +19,16 @@
19 19
 #
20 20
 class httpd::params {
21 21
 
22
-  $user          = 'www-data'
22
+  $auth          = false
23 23
   $group         = 'www-data'
24
-  $ssl           = true
25
-  $template      = 'httpd/vhost-default.conf.erb'
24
+  $options       = 'Indexes FollowSymLinks MultiViews'
26 25
   $priority      = '25'
27
-  $servername    = undef
28
-  $serveraliases = undef
29
-  $auth          = false
30 26
   $redirect_ssl  = false
31
-  $options       = 'Indexes FollowSymLinks MultiViews'
27
+  $serveraliases = undef
28
+  $servername    = undef
29
+  $ssl           = true
30
+  $template      = 'httpd/vhost-default.conf.erb'
31
+  $user          = 'www-data'
32 32
   $vhost_name    = '*'
33 33
 
34 34
   case $::operatingsystem {

+ 9
- 9
manifests/vhost.pp View File

@@ -29,19 +29,19 @@
29 29
 #  }
30 30
 #
31 31
 define httpd::vhost(
32
-    $port,
33 32
     $docroot,
33
+    $port,
34
+    $apache_name        = $httpd::params::apache_name,
35
+    $auth               = $httpd::params::auth,
34 36
     $configure_firewall = true,
35
-    $ssl                = $httpd::params::ssl,
36
-    $template           = $httpd::params::template,
37
+    $options            = $httpd::params::options,
37 38
     $priority           = $httpd::params::priority,
38
-    $servername         = $httpd::params::servername,
39
-    $serveraliases      = $httpd::params::serveraliases,
40
-    $auth               = $httpd::params::auth,
41 39
     $redirect_ssl       = $httpd::params::redirect_ssl,
42
-    $options            = $httpd::params::options,
43
-    $apache_name        = $httpd::params::apache_name,
44
-    $vhost_name         = $httpd::params::vhost_name
40
+    $serveraliases      = $httpd::params::serveraliases,
41
+    $servername         = $httpd::params::servername,
42
+    $ssl                = $httpd::params::ssl,
43
+    $template           = $httpd::params::template,
44
+    $vhost_name         = $httpd::params::vhost_name,
45 45
   ) {
46 46
 
47 47
   include ::httpd

+ 8
- 8
manifests/vhost/proxy.pp View File

@@ -19,16 +19,16 @@
19 19
 # Sample Usage:
20 20
 #
21 21
 define httpd::vhost::proxy (
22
-    $port,
23 22
     $dest,
24
-    $priority      = '10',
25
-    $template      = 'httpd/vhost-proxy.conf.erb',
26
-    $servername    = undef,
27
-    $serveraliases = undef,
28
-    $ssl           = false,
29
-    $vhost_name    = '*',
23
+    $port,
24
+    $docroot         = undef,
25
+    $priority        = '10',
30 26
     $proxyexclusions = undef,
31
-    $docroot       = undef,
27
+    $serveraliases   = undef,
28
+    $servername      = undef,
29
+    $ssl             = false,
30
+    $template        = 'httpd/vhost-proxy.conf.erb',
31
+    $vhost_name      = '*',
32 32
   ) {
33 33
 
34 34
   include ::httpd

Loading…
Cancel
Save