diff --git a/manifests/init.pp b/manifests/init.pp index eadb1c0..3155acb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,14 +20,18 @@ class elasticsearch ( $es_template_config = {} ) { # install java runtime - package { 'openjdk-7-jre-headless': - ensure => present, + if ! defined(Package['openjdk-7-jre-headless']) { + package { 'openjdk-7-jre-headless': + ensure => present, + } } # Curl is handy for talking to the ES API on localhost. Allows for # querying cluster state and deleting indexes and so on. - package { 'curl': - ensure => present, + if ! defined(Package['curl']) { + package { 'curl': + ensure => present, + } } exec { 'get_elasticsearch_deb': diff --git a/templates/elasticsearch.yml.erb b/templates/elasticsearch.yml.erb index b612213..04b20bd 100644 --- a/templates/elasticsearch.yml.erb +++ b/templates/elasticsearch.yml.erb @@ -86,6 +86,13 @@ node.name: "<%= scope.lookupvar("::hostname") %>" # to disable it, set the following: # node.max_local_storage_nodes: 1 +<% if es_template_config.has_key?('node.master') then -%> +node.master: <%= es_template_config['node.master'] %> +<% end -%> +<% if es_template_config.has_key?('node.data') then -%> +node.data: <%= es_template_config['node.data'] %> +<% end -%> + #################################### Index ####################################