Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Added support for Kibana 6 #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
default['kibana']['git']['config'] = 'kibana/config.js' # relative path of config file
default['kibana']['git']['config_template'] = 'config.js.erb' # template to use for config
default['kibana']['git']['config_template_cookbook'] = 'kibana_lwrp' # cookbook containing config template
default['kibana']['git']['config_template5'] = 'config.js.erb'

# Values to use for file method of installation
default['kibana']['file']['type'] = 'tgz' # zip | tgz
Expand All @@ -20,6 +21,7 @@
default['kibana']['file']['config'] = 'config/kibana.yml' # relative path of config file
default['kibana']['file']['config_template'] = 'kibana.yml.erb' # template to use for config
default['kibana']['file']['config_template_cookbook'] = 'kibana_lwrp' # cookbook containing config template
default['kibana']['file']['config_template5'] = 'kibana5.yml.erb'

# Kibana Java Web Server
default['kibana']['java_webserver_port'] = 5601
Expand Down
2 changes: 1 addition & 1 deletion libraries/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Provider::KibanaWeb < Chef::Provider::LWRPBase # ~FC057, ~FC058
when 'nginx'
node.set['nginx']['default_site_enabled'] = resources[:default_site_enabled]
node.set['nginx']['install_method'] = node['kibana']['nginx']['install_method']
@run_context.include_recipe 'chef_nginx'
@run_context.include_recipe 'nginx'

template "#{node['nginx']['dir']}/sites-available/#{resources[:name]}" do
source resources[:template]
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

version '3.0.2'

%w(git chef_nginx apache2 ark libarchive java runit compat_resource).each do |cb|
%w(git nginx apache2 ark libarchive java runit compat_resource).each do |cb|
depends cb
end

Expand Down
4 changes: 3 additions & 1 deletion recipes/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
kibana_config = "#{node['kibana']['install_dir']}/current/#{node['kibana'][install_type]['config']}"
es_server = "#{node['kibana']['es_scheme']}#{node['kibana']['es_server']}:#{node['kibana']['es_port']}"

config_template = Gem::Version.new(node['kibana']['version'].split('-')[0]) < Gem::Version.new('6.0.0')?'config_template_5':'config_template'

template kibana_config do
source node['kibana'][install_type]['config_template']
source node['kibana'][install_type][config_template]
cookbook node['kibana'][install_type]['config_template_cookbook']
mode '0644'
user kibana_user
Expand Down
29 changes: 6 additions & 23 deletions templates/default/kibana.yml.erb
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
<% if @port %>
# Kibana is served by a backend server. This controls which port to use.
port: <%= @port %>
server.port: <%= @port %>
<% end %>

<% if @elasticsearch %>
# The Elasticsearch instance to user for all your queries
elasticsearch_url: "<%= @elasticsearch %>"
elasticsearch.url: "<%= @elasticsearch %>"
<% end %>

<% if @index %>
# Kibana uses and index in Elasticsearch to store saved searches, visualizations
# and dashboard. It will create an new index if it doesn't already exist.
kibana_index: "<%= @index %>"
kibana.index: "<%= @index %>"
<% end %>

<% if @default_app_id %>
# The default application to load.
default_app_id: "<%= @default_app_id %>"
<% end %>

<% if @default_route %>
# The default route ["/"].
server.basePath: "<%= @default_route %>"
kibana.defaultAppId: "<%= @default_app_id %>"
<% end %>

# Time in milliseconds to wait for responses from the back end or elasticsearch.
# This must be > 0
request_timeout: 60000
elasticsearch.requestTimeout: 60000

# Time in milliseconds for Elasticsearch to wait for responses from shards.
# Note this should always be lower than "request_timeout".
# Set to 0 to disable (not recommended).
shard_timeout: 30000

# Plugins that are included in the build, and no longer found in the plugins/ folder
bundled_plugin_ids:
- plugins/dashboard/index
- plugins/discover/index
- plugins/doc/index
- plugins/kibana/index
- plugins/metric_vis/index
- plugins/settings/index
- plugins/table_vis/index
- plugins/vis_types/index
- plugins/visualize/index
elasticsearch.shardTimeout: 30000
46 changes: 46 additions & 0 deletions templates/default/kibana5.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<% if @port %>
# Kibana is served by a backend server. This controls which port to use.
port: <%= @port %>
<% end %>

<% if @elasticsearch %>
# The Elasticsearch instance to user for all your queries
elasticsearch_url: "<%= @elasticsearch %>"
<% end %>

<% if @index %>
# Kibana uses and index in Elasticsearch to store saved searches, visualizations
# and dashboard. It will create an new index if it doesn't already exist.
kibana_index: "<%= @index %>"
<% end %>

<% if @default_app_id %>
# The default application to load.
default_app_id: "<%= @default_app_id %>"
<% end %>

<% if @default_route %>
# The default route ["/"].
server.basePath: "<%= @default_route %>"
<% end %>

# Time in milliseconds to wait for responses from the back end or elasticsearch.
# This must be > 0
request_timeout: 60000

# Time in milliseconds for Elasticsearch to wait for responses from shards.
# Note this should always be lower than "request_timeout".
# Set to 0 to disable (not recommended).
shard_timeout: 30000

# Plugins that are included in the build, and no longer found in the plugins/ folder
bundled_plugin_ids:
- plugins/dashboard/index
- plugins/discover/index
- plugins/doc/index
- plugins/kibana/index
- plugins/metric_vis/index
- plugins/settings/index
- plugins/table_vis/index
- plugins/vis_types/index
- plugins/visualize/index