diff --git a/manifests/init.pp b/manifests/init.pp index 7eebb50..2987eaf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,9 @@ # # Class to install kibana frontend to logstash. # -class kibana { +class kibana ( + $elasticsearch_host = 'localhost' +) { group { 'kibana': ensure => present, @@ -67,7 +69,8 @@ class kibana { file { '/opt/kibana/kibana/KibanaConfig.rb': ensure => present, - source => 'puppet:///modules/kibana/config.rb', + content => template('kibana/config.rb.erb'), + replace => true, owner => 'kibana', group => 'kibana', require => Vcsrepo['/opt/kibana/kibana'], diff --git a/files/config.rb b/templates/config.rb.erb similarity index 98% rename from files/config.rb rename to templates/config.rb.erb index e45fee2..98f0d9f 100755 --- a/files/config.rb +++ b/templates/config.rb.erb @@ -7,7 +7,7 @@ module KibanaConfig # Your elastic search server(s). This may be set as an array for round robin # load balancing # Elasticsearch = ["elasticsearch1:9200","elasticsearch2:9200"] - Elasticsearch = "localhost:9200" + Elasticsearch = "<%= scope.lookupvar("::kibana::elasticsearch_host") %>:9200" #Set the Net::HTTP read/open timeouts for the connection to the ES backend ElasticsearchTimeout = 500