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: Icbf7252eae21f413290fcc80384ed3b71086bffa
This commit is contained in:
Andrey Nikitin 2016-03-21 11:20:27 +03:00
parent 0c3f449706
commit 0cbe4bfd8e
3 changed files with 52 additions and 52 deletions

View File

@ -15,24 +15,24 @@
# Class: cgit
#
class cgit(
$vhost_name = $::fqdn,
$serveradmin = "webmaster@${::fqdn}",
$serveraliases = undef,
$cgitdir = '/var/www/cgit',
$staticfiles = '/var/www/cgit/static',
$ssl_cert_file = undef,
$ssl_key_file = undef,
$ssl_chain_file = undef,
$ssl_cert_file_contents = undef, # If left undefined puppet will not create file.
$ssl_key_file_contents = undef, # If left undefined puppet will not create file.
$behind_proxy = false,
$cgit_timeout = false,
$cgitdir = '/var/www/cgit',
$cgitrc_settings = {},
$manage_cgitrc = false,
$mpm_settings = {}, # override the mpm worker settings
$prefork_settings = {}, # override the prefork worker settings
$selinux_mode = 'enforcing',
$serveradmin = "webmaster@${::fqdn}",
$serveraliases = undef,
$ssl_cert_file = undef,
$ssl_cert_file_contents = undef, # If left undefined puppet will not create file.
$ssl_chain_file = undef,
$ssl_chain_file_contents = undef, # If left undefined puppet will not create file.
$behind_proxy = false,
$cgit_timeout = false,
$manage_cgitrc = false,
$prefork_settings = {}, # override the prefork worker settings
$mpm_settings = {}, # override the mpm worker settings
$cgitrc_settings = {},
$selinux_mode = 'enforcing'
$ssl_key_file = undef,
$ssl_key_file_contents = undef, # If left undefined puppet will not create file.
$staticfiles = '/var/www/cgit/static',
$vhost_name = $::fqdn,
) {
validate_hash($prefork_settings)
validate_hash($mpm_settings)

View File

@ -15,22 +15,12 @@
# Class: cgit::lb
#
class cgit::lb (
$balancer_member_names = [],
$balancer_member_ips = [],
$balancer_member_http_ports = ['8080',],
$balancer_member_git_ports = ['29418',],
$balancer_member_http_ports = ['8080',],
$balancer_member_https_ports = ['4443',],
$balancer_member_git_ports = ['29418',],
$global_options = {
'log' => '127.0.0.1 local0',
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => '4000',
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats user root group root mode 0600 level admin'
},
$defaults_options = {
$balancer_member_ips = [],
$balancer_member_names = [],
$defaults_options = {
'log' => 'global',
'stats' => 'enable',
'option' => 'redispatch',
@ -45,19 +35,7 @@ class cgit::lb (
],
'maxconn' => '8000',
},
$http_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
$https_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
$git_options = {
$git_options = {
'maxconn' => '256',
'backlog' => '256',
'balance' => 'leastconn',
@ -65,6 +43,28 @@ class cgit::lb (
'tcplog',
],
},
$global_options = {
'log' => '127.0.0.1 local0',
'chroot' => '/var/lib/haproxy',
'pidfile' => '/var/run/haproxy.pid',
'maxconn' => '4000',
'user' => 'haproxy',
'group' => 'haproxy',
'daemon' => '',
'stats' => 'socket /var/lib/haproxy/stats user root group root mode 0600 level admin'
},
$http_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
$https_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
) {
package { 'socat':

View File

@ -35,14 +35,14 @@
# Array with the list of keys that will be used for authorizing git
# clones over ssh
class cgit::ssh (
$user = 'git',
$group = 'git',
$manage_group = true,
$home = '/var/lib/git',
$manage_home = true,
$target = undef,
$target_name = 'repo',
$authorized_keys = [],
$group = 'git',
$home = '/var/lib/git',
$manage_group = true,
$manage_home = true,
$target = undef,
$target_name = 'repo',
$user = 'git',
) {
if $manage_home {