forked from realityforge/chef-kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Corentin Chary
committed
Jun 18, 2018
1 parent
e489154
commit 992bef4
Showing
4 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# frozen_string_literal: true | ||
|
||
include_recipe 'kibana' | ||
|
||
if node['kibana']['install_method'] == 'release' | ||
ark 'kibana' do | ||
url node['kibana']['kibana6_url'] | ||
version node['kibana']['kibana6_version'] | ||
checksum node['kibana']['kibana6_checksum'] | ||
path node['kibana']['base_dir'] | ||
home_dir File.join(node['kibana']['base_dir'], 'current') | ||
owner node['kibana']['user'] | ||
end | ||
config_path = 'current/config/kibana.yml' | ||
elsif node['kibana']['install_method'] == 'package' | ||
node.default['kibana']['service']['bin_path'] = 'bin' | ||
if platform_family? 'debian' | ||
apt_repository 'kibana' do | ||
uri node['kibana']['repository_url'] | ||
distribution '' | ||
components %w[stable main] | ||
key node['kibana']['repository_key'] | ||
end | ||
else | ||
Chef::Log.warn "I do not support your platform: #{node['platform_family']}" | ||
end | ||
|
||
package 'kibana' | ||
config_path = 'config/kibana.yml' | ||
else | ||
Chef::Application.fatal!("Since Kibana version 4, install method can only be only 'release' or 'package'") | ||
end | ||
|
||
# Install service | ||
include_recipe 'kibana::_service' | ||
|
||
# Apply config template | ||
template File.join(node['kibana']['base_dir'], config_path) do | ||
cookbook node['kibana']['config']['cookbook'] | ||
source 'kibana6.yml.erb' | ||
owner node['kibana']['user'] | ||
group node['kibana']['group'] | ||
mode '0644' | ||
variables( | ||
bind: node['kibana']['interface'], | ||
port: node['kibana']['port'], | ||
es_user: node['kibana']['elasticsearch']['user'] || 'kibana', | ||
es_pass: node['kibana']['elasticsearch']['password'] || 'kibana', | ||
es_host: node['kibana']['elasticsearch']['hosts'].first, | ||
es_port: node['kibana']['elasticsearch']['port'], | ||
index: node['kibana']['index'], | ||
defaultapp: node['kibana']['defaultapp'], | ||
logging_option: node['kibana']['logging_option'], | ||
extra_config: node['kibana']['extra_config'] | ||
) | ||
notifies :restart, 'service[kibana]' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
# !! Managed by Chef, do not edit !! | ||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
# Kibana is served by a back end server. This controls which port to use. | ||
server.port: <%= @port %> | ||
|
||
# The host to bind the server to. | ||
server.host: "<%= @bind %>" | ||
|
||
# The Elasticsearch instance to use for all your queries. | ||
elasticsearch.url: "http://<%= @es_host %>:<%= @es_port %>" | ||
|
||
# preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, | ||
# then the host you use to connect to *this* Kibana instance will be sent. | ||
elasticsearch.preserveHost: true | ||
|
||
# Kibana uses an index in Elasticsearch to store saved searches, visualizations | ||
# and dashboards. It will create a new index if it doesn't already exist. | ||
kibana.index: "<%= @index %>" | ||
|
||
# If your Elasticsearch is protected with basic auth, this is the user credentials | ||
# used by the Kibana server to perform maintence on the kibana_index at statup. Your Kibana | ||
# users will still need to authenticate with Elasticsearch (which is proxied thorugh | ||
# the Kibana server) | ||
elasticsearch.username: <%= @es_user %> | ||
elasticsearch.password: <%= @es_pass %> | ||
|
||
# Optional settings that provide the paths to the PEM-format SSL certificate and key files. | ||
# These files validate that your Elasticsearch backend uses the same key files. | ||
# elasticsearch.ssl.cert: /path/to/your/client.crt | ||
# elasticsearch.ssl.key: /path/to/your/client.key | ||
|
||
# If you need to provide a CA certificate for your Elasticsarech instance, put | ||
# the path of the pem file here. | ||
# elasticsearch.ssl.ca: /path/to/your/CA.pem | ||
|
||
# The default application to load. | ||
kibana.defaultAppId: "<%= @defaultapp %>" | ||
|
||
# Time in milliseconds to wait for elasticsearch to respond to pings, defaults to | ||
# request_timeout setting | ||
# elasticsearch.pingTimeout: 1500 | ||
|
||
# Time in milliseconds to wait for responses from the back end or elasticsearch. | ||
# This must be > 0 | ||
elasticsearch.requestTimeout: 300000 | ||
|
||
# Time in milliseconds for Elasticsearch to wait for responses from shards. | ||
# Set to 0 to disable. | ||
elasticsearch.shardTimeout: 0 | ||
|
||
# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying | ||
# elasticsearch.startupTimeout: 5000 | ||
|
||
# SSL for outgoing requests from the Kibana Server (PEM formatted) | ||
# server.ssl.cert: /path/to/your/server.key | ||
# server.ssl.key: /path/to/your/server.crt | ||
|
||
# Set the path to where you would like the process id file to be created. | ||
# pid.file: /var/run/kibana.pid | ||
|
||
# If you would like to send the log output to a file you can set the path below. | ||
# This will also turn off the STDOUT log output. | ||
# logging.dest: ./kibana.log | ||
<%= @logging_option -%> | ||
|
||
# Extra config | ||
<% @extra_config.each do |k,v| %> | ||
<%= k %>: <%= v %> | ||
<% end %> |