dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp
changeset 407 2dba812c7ef2
parent 406 cf0f23803a53
child 410 240ca282331d
--- a/dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp	Wed Nov 09 15:05:41 2016 +0100
+++ b/dev/provisioning/modules/sysconfig/manifests/elasticsearch.pp	Wed Nov 09 23:41:15 2016 +0100
@@ -7,6 +7,11 @@
     notify {'elasticsearch': name => "\$es_host : ${es_host}, \$es_port : ${es_port}, \$es_instance : ${es_instance}", withpath => true }
 
 
+    exec { "systemd_restart_${es_instance}":
+        command     => '/bin/systemctl restart elasticsearch-${es_instance}',
+        refreshonly => true,
+    }
+
     class { '::elasticsearch':
       manage_repo  => true,
       autoupgrade => true,
@@ -39,14 +44,12 @@
         mode => '0750'
 
     } ->
-    file {  '$es_instance service file':
+    file { '$es_instance service file':
         path => "/usr/lib/systemd/system/elasticsearch-${es_instance}.service",
         source => "puppet:///modules/sysconfig/elasticsearch/elasticsearch-${es_instance}.service",
         owner => 'root',
         group => 'root',
-        mode => '0750'
-
-    } ~>
-    Exec['systemctl-daemon-reload']
-
+        mode => '0750',
+        notify => [Exec['systemctl-daemon-reload'], Exec["systemd_restart_${es_instance}"]]
+    }
 }