dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp
changeset 410 240ca282331d
parent 407 2dba812c7ef2
equal deleted inserted replaced
409:8371c99c7947 410:240ca282331d
     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 
     9 
    10     exec { "systemd_restart_${es_instance}":
    10     exec { "systemd_restart_${es_instance}":
    11         command     => '/bin/systemctl restart elasticsearch-${es_instance}',
    11         command     => "/bin/systemctl start elasticsearch-${es_instance}",
       
    12         refreshonly => true,
       
    13     }
       
    14 
       
    15     exec { "systemd_enable_${es_instance}":
       
    16         command     => "/bin/systemctl enable elasticsearch-${es_instance}",
    12         refreshonly => true,
    17         refreshonly => true,
    13     }
    18     }
    14 
    19 
    15     class { '::elasticsearch':
    20     class { '::elasticsearch':
    16       manage_repo  => true,
    21       manage_repo  => true,
    17       autoupgrade => true,
    22       autoupgrade => true,
    18       repo_version => '5.x',
    23       repo_version => '5.x',
       
    24       status => 'unmanaged',
    19     }->
    25     }->
    20     elasticsearch::instance { $es_instance: }->
    26     elasticsearch::instance { $es_instance: }->
    21     file { '$es_instance jvm.options':
    27     file { '$es_instance jvm.options':
    22         path => "/etc/elasticsearch/${es_instance}/jvm.options",
    28         path => "/etc/elasticsearch/${es_instance}/jvm.options",
    23         source => "puppet:///modules/sysconfig/elasticsearch/jvm.options",
    29         source => "puppet:///modules/sysconfig/elasticsearch/jvm.options",
    48         path => "/usr/lib/systemd/system/elasticsearch-${es_instance}.service",
    54         path => "/usr/lib/systemd/system/elasticsearch-${es_instance}.service",
    49         source => "puppet:///modules/sysconfig/elasticsearch/elasticsearch-${es_instance}.service",
    55         source => "puppet:///modules/sysconfig/elasticsearch/elasticsearch-${es_instance}.service",
    50         owner => 'root',
    56         owner => 'root',
    51         group => 'root',
    57         group => 'root',
    52         mode => '0750',
    58         mode => '0750',
    53         notify => [Exec['systemctl-daemon-reload'], Exec["systemd_restart_${es_instance}"]]
    59         notify => [Exec['systemctl-daemon-reload'], Exec["systemd_enable_${es_instance}"], Exec["systemd_restart_${es_instance}"]]
    54     }
    60     }
    55 }
    61 }