dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp
changeset 407 2dba812c7ef2
parent 406 cf0f23803a53
child 410 240ca282331d
equal deleted inserted replaced
406:cf0f23803a53 407:2dba812c7ef2
     4     $es_instance = hiera('sysconfig::params::es_instance', $sysconfig::params::es_instance),
     4     $es_instance = hiera('sysconfig::params::es_instance', $sysconfig::params::es_instance),
     5 ) inherits sysconfig::params {
     5 ) inherits sysconfig::params {
     6 
     6 
     7     notify {'elasticsearch': name => "\$es_host : ${es_host}, \$es_port : ${es_port}, \$es_instance : ${es_instance}", withpath => true }
     7     notify {'elasticsearch': name => "\$es_host : ${es_host}, \$es_port : ${es_port}, \$es_instance : ${es_instance}", withpath => true }
     8 
     8 
       
     9 
       
    10     exec { "systemd_restart_${es_instance}":
       
    11         command     => '/bin/systemctl restart elasticsearch-${es_instance}',
       
    12         refreshonly => true,
       
    13     }
     9 
    14 
    10     class { '::elasticsearch':
    15     class { '::elasticsearch':
    11       manage_repo  => true,
    16       manage_repo  => true,
    12       autoupgrade => true,
    17       autoupgrade => true,
    13       repo_version => '5.x',
    18       repo_version => '5.x',
    37         owner => 'root',
    42         owner => 'root',
    38         group => 'elasticsearch',
    43         group => 'elasticsearch',
    39         mode => '0750'
    44         mode => '0750'
    40 
    45 
    41     } ->
    46     } ->
    42     file {  '$es_instance service file':
    47     file { '$es_instance service file':
    43         path => "/usr/lib/systemd/system/elasticsearch-${es_instance}.service",
    48         path => "/usr/lib/systemd/system/elasticsearch-${es_instance}.service",
    44         source => "puppet:///modules/sysconfig/elasticsearch/elasticsearch-${es_instance}.service",
    49         source => "puppet:///modules/sysconfig/elasticsearch/elasticsearch-${es_instance}.service",
    45         owner => 'root',
    50         owner => 'root',
    46         group => 'root',
    51         group => 'root',
    47         mode => '0750'
    52         mode => '0750',
    48 
    53         notify => [Exec['systemctl-daemon-reload'], Exec["systemd_restart_${es_instance}"]]
    49     } ~>
    54     }
    50     Exec['systemctl-daemon-reload']
       
    51 
       
    52 }
    55 }