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

View File

@ -15,22 +15,12 @@
# Class: cgit::lb # Class: cgit::lb
# #
class cgit::lb ( class cgit::lb (
$balancer_member_names = [], $balancer_member_git_ports = ['29418',],
$balancer_member_ips = [], $balancer_member_http_ports = ['8080',],
$balancer_member_http_ports = ['8080',],
$balancer_member_https_ports = ['4443',], $balancer_member_https_ports = ['4443',],
$balancer_member_git_ports = ['29418',], $balancer_member_ips = [],
$global_options = { $balancer_member_names = [],
'log' => '127.0.0.1 local0', $defaults_options = {
'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 = {
'log' => 'global', 'log' => 'global',
'stats' => 'enable', 'stats' => 'enable',
'option' => 'redispatch', 'option' => 'redispatch',
@ -45,19 +35,7 @@ class cgit::lb (
], ],
'maxconn' => '8000', 'maxconn' => '8000',
}, },
$http_options = { $git_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
$https_options = {
'balance' => 'leastconn',
'option' => [
'tcplog',
],
},
$git_options = {
'maxconn' => '256', 'maxconn' => '256',
'backlog' => '256', 'backlog' => '256',
'balance' => 'leastconn', 'balance' => 'leastconn',
@ -65,6 +43,28 @@ class cgit::lb (
'tcplog', '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': package { 'socat':

View File

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