From 080f4bab6a04f16e7e03b545831a0ff9a9eec985 Mon Sep 17 00:00:00 2001 From: Andrey Nikitin Date: Mon, 21 Mar 2016 12:26:53 +0300 Subject: [PATCH] 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 --- manifests/logrotate.pp | 10 +++++----- manifests/params.pp | 14 +++++++------- manifests/vhost.pp | 18 +++++++++--------- manifests/vhost/proxy.pp | 16 ++++++++-------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/manifests/logrotate.pp b/manifests/logrotate.pp index 7418782..d4356e4 100644 --- a/manifests/logrotate.pp +++ b/manifests/logrotate.pp @@ -1,7 +1,9 @@ # == Class: httpd::logrotate # class httpd::logrotate ( - $options = [ + $firstaction = 'undef', + $lastaction = 'undef', + $options = [ 'daily', 'missingok', 'rotate 30', @@ -10,16 +12,14 @@ class httpd::logrotate ( 'notifempty', 'create 640 root adm', ], - $prerotate = [ + $prerotate = [ "if [ -d /etc/logrotate.d/${::httpd::params::apache_name}-prerotate ]; then \\", " run-parts /etc/logrotate.d/${::httpd::params::apache_name}-prerotate; fi ; \\", ], - $postrotate = [ + $postrotate = [ "if service ${::httpd::params::apache_name} status > /dev/null; then \\", " service ${::httpd::params::apache_name} reload > /dev/null; fi; \\", ], - $firstaction = 'undef', - $lastaction = 'undef', ) inherits httpd::params { include ::logrotate diff --git a/manifests/params.pp b/manifests/params.pp index 66b99f7..5297046 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,16 +19,16 @@ # class httpd::params { - $user = 'www-data' + $auth = false $group = 'www-data' + $options = 'Indexes FollowSymLinks MultiViews' + $priority = '25' + $redirect_ssl = false + $serveraliases = undef + $servername = undef $ssl = true $template = 'httpd/vhost-default.conf.erb' - $priority = '25' - $servername = undef - $serveraliases = undef - $auth = false - $redirect_ssl = false - $options = 'Indexes FollowSymLinks MultiViews' + $user = 'www-data' $vhost_name = '*' case $::operatingsystem { diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 5c9ded6..86e4870 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -29,19 +29,19 @@ # } # define httpd::vhost( - $port, $docroot, + $port, + $apache_name = $httpd::params::apache_name, + $auth = $httpd::params::auth, $configure_firewall = true, + $options = $httpd::params::options, + $priority = $httpd::params::priority, + $redirect_ssl = $httpd::params::redirect_ssl, + $serveraliases = $httpd::params::serveraliases, + $servername = $httpd::params::servername, $ssl = $httpd::params::ssl, $template = $httpd::params::template, - $priority = $httpd::params::priority, - $servername = $httpd::params::servername, - $serveraliases = $httpd::params::serveraliases, - $auth = $httpd::params::auth, - $redirect_ssl = $httpd::params::redirect_ssl, - $options = $httpd::params::options, - $apache_name = $httpd::params::apache_name, - $vhost_name = $httpd::params::vhost_name + $vhost_name = $httpd::params::vhost_name, ) { include ::httpd diff --git a/manifests/vhost/proxy.pp b/manifests/vhost/proxy.pp index 54e814c..a79c927 100644 --- a/manifests/vhost/proxy.pp +++ b/manifests/vhost/proxy.pp @@ -19,16 +19,16 @@ # Sample Usage: # define httpd::vhost::proxy ( - $port, $dest, - $priority = '10', - $template = 'httpd/vhost-proxy.conf.erb', - $servername = undef, - $serveraliases = undef, - $ssl = false, - $vhost_name = '*', + $port, + $docroot = undef, + $priority = '10', $proxyexclusions = undef, - $docroot = undef, + $serveraliases = undef, + $servername = undef, + $ssl = false, + $template = 'httpd/vhost-proxy.conf.erb', + $vhost_name = '*', ) { include ::httpd