From fce067853a11134885e436b11e1ca3e401e48a18 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 18 Apr 2014 14:53:10 -0700 Subject: [PATCH] Silence successful elasticsearch runs java7-runtime-headless is an empty package that can never be installed, so it attempts to install every time. Replace it with openjdk-7-jre-headless, which is the real package. Also, add a refreshonly on the exec for checking the diff, because it runs every time as well. Change-Id: I5195d27ae90cd7f9f3e20d92aca43d7b8d0e504a --- manifests/init.pp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5a4524b..91ada4a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,7 +20,7 @@ class elasticsearch ( $es_template_config = {} ) { # install java runtime - package { 'java7-runtime-headless': + package { 'openjdk-7-jre-headless': ensure => present, } @@ -53,9 +53,11 @@ class elasticsearch ( } exec { 'check_elasticsearch_sha1': - command => "diff /tmp/elasticsearch-${version}.deb.sha1.txt /tmp/elasticsearch-${version}.deb.sha1.gen", - path => '/bin:/usr/bin', - require => [ + command => "diff /tmp/elasticsearch-${version}.deb.sha1.txt /tmp/elasticsearch-${version}.deb.sha1.gen", + path => '/bin:/usr/bin', + subscribe => Exec['get_elasticsearch_deb'], + refreshonly => true, + require => [ Exec['gen_elasticsearch_deb_sha1'], Exec['get_elasticsearch_deb_sha1'], ] @@ -66,10 +68,9 @@ class elasticsearch ( ensure => latest, source => "/tmp/elasticsearch-${version}.deb", provider => 'dpkg', - subscribe => Exec['get_elasticsearch_deb'], + subscribe => Exec['get_elasticsearch_sha1'], require => [ Package['java7-runtime-headless'], - Exec['check_elasticsearch_sha1'], File['/etc/elasticsearch/elasticsearch.yml'], File['/etc/elasticsearch/default-mapping.json'], File['/etc/default/elasticsearch'],