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
This commit is contained in:
Emilien Macchi 2015-05-05 12:20:56 -04:00
parent ef4cc0f0d0
commit e22400fb45
2 changed files with 9 additions and 2 deletions

View File

@ -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',

View File

@ -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