1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
# OS specific configuration should be defined here
#
# PRIVATE CLASS - do not use directly (use main `zookeeper` class).
class zookeeper::params {
$_defaults = {
'packages' => ['zookeeper'],
}
case $facts['os']['family'] {
'Debian': {
case $facts['os']['name'] {
'Debian': {
case $facts['os']['release']['major'] {
'7': { $initstyle = 'init' }
'8': { $initstyle = 'systemd' }
default: { $initstyle = undef }
}
}
'Ubuntu': {
case $facts['os']['release']['major'] {
'14.04': { $initstyle = 'upstart' }
default: { $initstyle = undef }
}
}
default: { $initstyle = undef }
}
$_os_overrides = {
'packages' => ['zookeeper', 'zookeeperd'],
'service_name' => 'zookeeper',
'service_provider' => $initstyle,
'shell' => '/bin/false',
}
# 'environment' file probably read just by Debian
# see #16, #81
$environment_file = 'environment'
}
'RedHat': {
case $facts['os']['release']['major'] {
'6': { $initstyle = 'redhat' }
'7': { $initstyle = 'systemd' }
default: { $initstyle = undef }
}
$_os_overrides = {
'packages' => ['zookeeper', 'zookeeper-server'],
'service_name' => 'zookeeper-server',
'service_provider' => $initstyle,
'shell' => '/sbin/nologin',
}
$environment_file = 'java.env'
}
default: {
fail("Module '${module_name}' is not supported on OS: '${::facts['os']['name']}', family: '${::facts['os']['family']}'")
}
}
$_params = merge($_defaults, $_os_overrides)
# meta options
$ensure = present
$ensure_account = present
$ensure_cron = true
$group = 'zookeeper'
$system_group = false
$packages = $_params['packages']
$shell = $_params['shell']
$user = 'zookeeper'
$system_user = false
# installation options
$archive_checksum = {}
$archive_dl_site = 'http://apache.org/dist/zookeeper'
$archive_dl_timeout = 600
$archive_dl_url = undef
$archive_install_dir = '/opt'
$archive_symlink = true
$archive_symlink_name = "${archive_install_dir}/zookeeper"
$archive_version = '3.4.8'
$cdhver = undef
$install_java = false
$install_method = 'package'
$java_bin = '/usr/bin/java'
$java_opts = ''
$java_package = undef
$repo = undef
# service options
$manage_service = true
$manage_service_file = false
$pid_dir = '/var/run'
$pid_file = undef
$restart_on_change = true
$service_ensure = 'running'
$service_name = $_params['service_name']
$service_provider = $_params['service_provider']
# systemd_unit_want and _after can be overridden to
# donate the matching directives in the [Unit] section
$systemd_unit_want = undef
$systemd_unit_after = 'network.target'
$systemd_path = '/etc/systemd/system'
$zk_dir = '/etc/zookeeper'
# zookeeper config
$cfg_dir = '/etc/zookeeper/conf'
$cleanup_sh = '/usr/share/zookeeper/bin/zkCleanup.sh'
$client_ip = undef # use e.g. $::ipaddress if you want to bind to single interface
$client_port = 2181
$datastore = '/var/lib/zookeeper'
# datalogstore used to put transaction logs in separate location than snapshots
$datalogstore = undef
$election_port = 2888
$export_tag = 'zookeeper'
$id = '1'
$init_limit = 10
$initialize_datastore = false
$leader = true
$leader_port = 3888
$log_dir = '/var/log/zookeeper'
$manual_clean = false
$max_allowed_connections = undef
$max_session_timeout = undef
$min_session_timeout = undef
$observers = []
# interval in hours, purging enabled when >= 1
$purge_interval = 0
$servers = []
$snap_count = 10000
# since zookeeper 3.4, for earlier version cron task might be used
$snap_retain_count = 3
$sync_limit = 5
$tick_time = 2000
$use_sasl_auth = false
$zoo_dir = '/usr/lib/zookeeper'
$zoo_main = 'org.apache.zookeeper.server.quorum.QuorumPeerMain'
# log4j properties
$log4j_prop = 'INFO,ROLLINGFILE'
$peer_type = 'UNSET'
$rollingfile_threshold = 'INFO'
$console_threshold = 'INFO'
$tracefile_threshold = 'TRACE'
$maxfilesize = '256MB'
$maxbackupindex = 20
if $facts['networking']['fqdn'] {
$fqdn = $facts['networking']['fqdn']
}else{
$fqdn = $::fqdn
}
# sasl options
$sasl_krb5 = true
$sasl_users = {}
$keytab_path = '/etc/zookeeper/conf/zookeeper.keytab'
$principal = "zookeeper/${fqdn}"
$realm = $facts['networking']['domain']
$store_key = true
$use_keytab = true
$use_ticket_cache = false
$remove_host_principal = false
$remove_realm_principal = false
}
|