From e22400fb45f04fff4756fc1e2dd056e28701279e Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 5 May 2015 12:20:56 -0400 Subject: [PATCH] logging: enable HTTP CORS for fluentd ES instance Elasticsearch package has been upgrade to 1.4.x in J.1.1.0 and J.1.2.0 (1.0.3 in J.1.0.0) but kibana web interface is not compatible with elasticsearch 1.4.x or higher if you don't change the configuration on the service. Change-Id: I19c1a0b08aa63ca0fad6b1a2c390e13775efa443 Closes-bug: #1451828 --- manifests/logging/server.pp | 7 ++++++- spec/classes/cloud_logging_server_spec.rb | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/manifests/logging/server.pp b/manifests/logging/server.pp index b7bb7c89..bca3a9ad 100644 --- a/manifests/logging/server.pp +++ b/manifests/logging/server.pp @@ -40,7 +40,12 @@ class cloud::logging::server( include ::kibana3 include cloud::database::nosql::elasticsearch include cloud::logging::agent - elasticsearch::instance {'fluentd' : } + + # Elasticsearch 1.4 ships with a security setting that prevents Kibana from connecting. + # We need to allow http cors in fluentd instance. + elasticsearch::instance {'fluentd' : + config => { 'http' => { 'cors.enabled' => true } } + } @@haproxy::balancermember{"${::fqdn}-kibana": listening_service => 'kibana', diff --git a/spec/classes/cloud_logging_server_spec.rb b/spec/classes/cloud_logging_server_spec.rb index c00485e4..f66e7036 100644 --- a/spec/classes/cloud_logging_server_spec.rb +++ b/spec/classes/cloud_logging_server_spec.rb @@ -39,7 +39,9 @@ describe 'cloud::logging::server' do end it 'configure an elasticsearch instance' do - is_expected.to contain_elasticsearch__instance('fluentd') + is_expected.to contain_elasticsearch__instance('fluentd').with( + :config => { 'http' => { 'cors.enabled' => true } } + ) end context 'with default firewall enabled' do