This repository has been archived by the owner on Feb 12, 2019. It is now read-only.
forked from realityforge/chef-kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
11 changed files
with
249 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ group :vagrant do | |
cookbook 'apt' | ||
cookbook 'apache2' | ||
cookbook 'nginx' | ||
cookbook 'java' | ||
cookbook 'elasticsearch' | ||
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
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,39 @@ | ||
class Kibana | ||
# All to find correct url to download kibana | ||
class Url | ||
def initialize(node, version) | ||
@node = node | ||
@version = version | ||
end | ||
|
||
def get | ||
prefix = 'https://download.elasticsearch.org/kibana/kibana/kibana-' | ||
suffix = case @version | ||
when /^3\./ | ||
"#{@version}.#{ext}" | ||
else | ||
"#{@version}-#{@node['os']}#{arch}.#{ext}" | ||
end | ||
prefix + suffix | ||
end | ||
|
||
def ext | ||
case @node['os'] | ||
when 'windows' | ||
'zip' | ||
else | ||
'tar.gz' | ||
end | ||
end | ||
|
||
def arch | ||
return '' if @node['os'] == 'windows' | ||
case @node['kernel']['machine'] | ||
when 'x86_64' | ||
'-x64' | ||
else | ||
'-x86' | ||
end | ||
end | ||
end | ||
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 |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
suggests 'authbind' | ||
suggests 'apt' | ||
suggests 'nginx' | ||
suggests 'java' | ||
suggests 'elasticsearch' |
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,18 @@ | ||
# Encoding: utf-8 | ||
|
||
service 'kibana' do | ||
provider Chef::Provider::Service::Upstart | ||
supports start: true, restart: true, stop: true, status: true | ||
action :nothing | ||
end | ||
|
||
template '/etc/init/kibana.conf' do | ||
cookbook node['kibana']['service']['cookbook'] | ||
source node['kibana']['service']['source'] | ||
variables( | ||
version: node['kibana']['version'], | ||
options: '', # TODO | ||
recent_upstart: (node['platform_family'] != 'rhel'), | ||
) | ||
notifies :restart, 'service[kibana]', :delayed | ||
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,35 @@ | ||
# Encoding: utf-8 | ||
|
||
include_recipe 'kibana' | ||
|
||
if node['kibana']['install_method'] == 'release' | ||
ark 'kibana' do | ||
url node['kibana']['url'] | ||
version node['kibana']['kibana4_version'] | ||
checksum node['kibana']['kibana4_checksum'] | ||
path node['kibana']['base_dir'] | ||
home_dir File.join(node['kibana']['base_dir'], 'current') | ||
end | ||
config_path = 'current/config/kibana.yml' | ||
else | ||
Chef::Application.fatal!("Since Kibana version 4, install method can only be only 'release'") | ||
end | ||
|
||
# Apply config template | ||
template File.join(node['kibana']['base_dir'], config_path) do | ||
cookbook node['kibana']['config']['cookbook'] | ||
source node['kibana']['config']['source'] | ||
owner node['kibana']['user'] | ||
group node['kibana']['group'] | ||
mode '0644' | ||
variables( | ||
es_port: node['kibana']['elasticsearch']['port'], | ||
port: node['kibana']['port'], | ||
bind: node['kibana']['interface'], | ||
es_host: node['kibana']['elasticsearch']['hosts'].first, | ||
) | ||
notifies :restart, 'service[kibana]' | ||
end | ||
|
||
# Install service | ||
include_recipe 'kibana::_service' |
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,68 @@ | ||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
# !! Managed by Chef, do not edit !! | ||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
# Kibana is served by a back end server. This controls which port to use. | ||
port: <%= @port %> | ||
|
||
# The host to bind the server to. | ||
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_preserve_host: 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: ".kibana" | ||
|
||
# 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) | ||
# kibana_elasticsearch_username: user | ||
# kibana_elasticsearch_password: pass | ||
|
||
|
||
# The default application to load. | ||
default_app_id: "discover" | ||
|
||
# Time in milliseconds to wait for responses from the back end or elasticsearch. | ||
# This must be > 0 | ||
request_timeout: 300000 | ||
|
||
# Time in milliseconds for Elasticsearch to wait for responses from shards. | ||
# Set to 0 to disable. | ||
shard_timeout: 0 | ||
|
||
# Set to false to have a complete disregard for the validity of the SSL | ||
# certificate. | ||
verify_ssl: true | ||
|
||
# If you need to provide a CA certificate for your Elasticsarech instance, put | ||
# the path of the pem file here. | ||
# ca: /path/to/your/CA.pem | ||
|
||
# SSL for outgoing requests from the Kibana Server (PEM formatted) | ||
# ssl_key_file: /path/to/your/server.key | ||
# ssl_cert_file: /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 | ||
|
||
|
||
# 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/markdown_vis/index | ||
- plugins/metric_vis/index | ||
- plugins/settings/index | ||
- plugins/table_vis/index | ||
- plugins/vis_types/index | ||
- plugins/visualize/index |
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