1 # == Class: elasticsearch::config
3 # This class exists to coordinate all configuration related actions,
4 # functionality and logical units in a central place.
9 # This class does not provide any parameters.
14 # This class may be imported by other classes to use its functionality:
15 # class { 'elasticsearch::config': }
17 # It is not intended to be used directly by external resources like node
18 # definitions or other modules.
23 # * Richard Pijnenburg <mailto:richard.pijnenburg@elasticsearch.com>
25 class elasticsearch::config {
30 owner => $elasticsearch::elasticsearch_user,
31 group => $elasticsearch::elasticsearch_group
35 path => [ '/bin', '/usr/bin', '/usr/local/bin' ],
39 if ( $elasticsearch::ensure == 'present' ) {
41 $notify_service = $elasticsearch::restart_on_change ? {
42 true => Class['elasticsearch::service'],
46 file { $elasticsearch::configdir:
51 file { $elasticsearch::params::logdir:
52 ensure => 'directory',
58 file { $elasticsearch::params::homedir:
62 file { "${elasticsearch::params::homedir}/bin":
63 ensure => 'directory',
68 file { $elasticsearch::plugindir:
69 ensure => 'directory',
73 file { $elasticsearch::datadir:
77 file { "${elasticsearch::homedir}/lib":
78 ensure => 'directory',
82 if $elasticsearch::params::pid_dir {
83 file { $elasticsearch::params::pid_dir:
84 ensure => 'directory',
90 exec { 'mkdir_templates_elasticsearch':
91 command => "mkdir -p ${elasticsearch::configdir}/templates_import",
92 creates => "${elasticsearch::configdir}/templates_import",
95 file { "${elasticsearch::configdir}/templates_import":
96 ensure => 'directory',
98 require => [ Exec['mkdir_templates_elasticsearch'] ]
101 # Removal of files that are provided with the package which we don't use
102 file { '/etc/init.d/elasticsearch':
105 file { '/usr/lib/systemd/system/elasticsearch.service':
109 file { "${elasticsearch::params::defaults_location}/elasticsearch":
113 file { '/etc/elasticsearch/elasticsearch.yml':
116 file { '/etc/elasticsearch/logging.yml':
120 } elsif ( $elasticsearch::ensure == 'absent' ) {
121 # don't remove anything for now