1 # == Class: elasticsearch::params
4 # 1. Declutter the default value assignment for class parameters.
5 # 2. Manage internally used module variables in a central place.
7 # Therefore, many operating system dependent differences (names, paths, ...)
8 # are addressed in here.
13 # This class does not provide any parameters.
18 # This class is not intended to be used directly.
23 # * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY]
28 # * Richard Pijnenburg <mailto:richard@ispavailability.com>
30 class elasticsearch::params {
32 #### Default values for the parameters of the main module class, init.pp
43 # restart on configuration change?
44 $restart_on_change = true
46 # Purge configuration directory
47 $purge_configdir = false
49 $purge_package_dir = false
51 # package download timeout
52 $package_dl_timeout = 600 # 300 seconds is default of puppet
54 $default_logging_level = 'INFO'
58 'com.amazonaws' => 'WARN',
59 'index.search.slowlog' => 'TRACE, index_search_slow_log_file',
60 'index.indexing.slowlog' => 'TRACE, index_indexing_slow_log_file',
63 #### Internal module values
65 # User and Group for the files and user to run the service as.
68 $elasticsearch_user = 'elasticsearch'
69 $elasticsearch_group = 'elasticsearch'
72 $elasticsearch_user = 'elasticsearch'
73 $elasticsearch_group = 'elasticsearch'
76 fail("\"${module_name}\" provides no user/group default value
85 $download_tool = 'wget --no-check-certificate -O'
88 $download_tool = 'curl --insecure -o'
91 fail("\"${module_name}\" provides no download tool default value
96 # Different path definitions
99 $configdir = '/etc/elasticsearch'
100 $logdir = '/var/log/elasticsearch'
101 $package_dir = '/opt/elasticsearch/swdl'
102 $installpath = '/opt/elasticsearch'
103 $homedir = '/usr/share/elasticsearch'
104 $plugindir = "${homedir}/plugins"
105 $plugintool = "${homedir}/bin/plugin"
106 $datadir = '/usr/share/elasticsearch/data'
109 fail("\"${module_name}\" provides no config directory default value
110 for \"${::kernel}\"")
115 case $::operatingsystem {
116 'RedHat', 'CentOS', 'Fedora', 'Scientific', 'Amazon', 'OracleLinux', 'SLC': {
118 $package = [ 'elasticsearch' ]
120 'Debian', 'Ubuntu': {
122 $package = [ 'elasticsearch' ]
125 $package = [ 'elasticsearch' ]
128 fail("\"${module_name}\" provides no package default value
129 for \"${::operatingsystem}\"")
134 case $::operatingsystem {
135 'RedHat', 'CentOS', 'Fedora', 'Scientific', 'Amazon', 'OracleLinux', 'SLC': {
137 case $::operatingsystemmajrelease {
139 $init_template = 'elasticsearch.systemd.erb'
140 $service_providers = 'systemd'
143 $init_template = 'elasticsearch.RedHat.erb'
144 $service_providers = [ 'init' ]
148 $service_name = 'elasticsearch'
149 $service_hasrestart = true
150 $service_hasstatus = true
151 $service_pattern = $service_name
152 $defaults_location = '/etc/sysconfig'
153 $pid_dir = '/var/run/elasticsearch'
155 'Debian', 'Ubuntu': {
156 $service_name = 'elasticsearch'
157 $service_hasrestart = true
158 $service_hasstatus = true
159 $service_pattern = $service_name
160 $service_providers = 'init'
161 $defaults_location = '/etc/default'
162 $init_template = 'elasticsearch.Debian.erb'
166 $service_name = 'FIXME/TODO'
167 $service_hasrestart = true
168 $service_hasstatus = true
169 $service_pattern = $service_name
170 $service_providers = 'launchd'
171 $defaults_location = false
175 $service_name = 'elasticsearch'
176 $service_hasrestart = true
177 $service_hasstatus = true
178 $service_pattern = $service_name
179 $service_providers = 'systemd'
180 $defaults_location = '/etc/sysconfig'
181 $init_template = 'elasticsearch.systemd.erb'
182 $pid_dir = '/var/run/elasticsearch'
185 fail("\"${module_name}\" provides no service parameters
186 for \"${::operatingsystem}\"")