Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3379d67
Update default.rb
jolcese Nov 24, 2014
6c89497
Merge pull request #37 from jolcese/patch-1
realityforge Nov 24, 2014
f3a2dd8
Update config.js.erb
jolcese Nov 24, 2014
d3519d8
Merge pull request #38 from jolcese/master
realityforge Nov 24, 2014
2c5d20a
Sync with metadata.rb
niku Dec 11, 2014
24d20a3
Merge pull request #39 from niku/patch-1
realityforge Dec 15, 2014
3ac36de
Regenerate the README using knife-cookbook-doc
realityforge Dec 15, 2014
29505b1
Whitout this check the only method to get running proxy configuration…
Feb 2, 2015
7b5eb59
Merge pull request #42 from gagor/master
realityforge Feb 2, 2015
afa21c8
Support for KIbana 4
May 10, 2015
27e43a4
Merge pull request #46 from vvanholl/master
realityforge May 11, 2015
47f9678
Corrected default interface for Kibana service
May 12, 2015
9bdf98b
Added the possibility to change to default app on Kibana 4 load
May 12, 2015
fba37c5
Merge pull request #47 from vvanholl/master
realityforge May 12, 2015
16d10b0
Merge branch 'master' of https://github.com/realityforge/chef-kibana …
isaoshimizu May 22, 2015
b87980d
Correct vhost configuration
odolbeau Jun 8, 2015
06ac9c4
Switched to Kibana 4.1.0
Jun 15, 2015
52ab02a
Merge pull request #49 from vvanholl/master
realityforge Jun 15, 2015
317b6a0
Add kibana::kibana4 recipe to the list
spajus Jun 18, 2015
aa684a5
Merge pull request #51 from spajus/patch-1
realityforge Jun 18, 2015
91fd1e1
Apache2 support for Kibana 4
Jul 17, 2015
acf81ae
Merge pull request #52 from vvanholl/master
realityforge Aug 5, 2015
8945f99
Merge branch 'master' into support_kibana4
isaoshimizu Aug 17, 2015
6d39c1e
minor fix for Rubocop
Aug 18, 2015
ac1f9f9
Merge pull request #54 from shopping-adventure/master
realityforge Aug 20, 2015
1614918
Bump the version of rubocop
realityforge Aug 20, 2015
0b246dd
Merge branch 'correct-apache' of https://github.com/odolbeau/chef-kib…
realityforge Aug 20, 2015
491c9aa
Merge branch 'odolbeau-correct-apache'
realityforge Aug 20, 2015
3a3c927
Whitespace
realityforge Aug 20, 2015
6f2db1f
Re-add missing quote
realityforge Aug 20, 2015
eef40c5
Fix whitespace, update Berkshelf source
mburns Aug 25, 2015
eb073bf
Merge pull request #55 from mburns/patch-1
realityforge Aug 25, 2015
136612a
Correct vhost configuration for kibana4
atward Sep 22, 2015
7f492fc
Merge pull request #56 from atward/kibana4-vhost
realityforge Sep 22, 2015
db946ec
Bump to 4.1.2 version of Kibana
ihorbilovus Nov 2, 2015
002db32
Update download url
ihorbilovus Nov 2, 2015
71ae7e3
Bump kibana version to 4.2.0
ihorbilovus Nov 2, 2015
dbd1f09
Merge branch 'master' into support_kibana4
isaoshimizu Dec 17, 2015
469bd45
Add ark owner/group
isaoshimizu Dec 17, 2015
dca6bfc
use elasticsearch_host for kibana.yml
isaoshimizu Dec 17, 2015
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
40 changes: 39 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
network:
- ["forwarded_port", {guest: 80, host: 8080}]
- ["forwarded_port", {guest: 8080, host: 8080}]

platforms:
- name: ubuntu-12.04
Expand All @@ -30,6 +30,8 @@ suites:
attributes:
kibana:
version: '3'
nginx:
listen_http: 8080
- name: kibana3_nginx
run_list:
- 'recipe[kibana]'
Expand All @@ -46,4 +48,40 @@ suites:
attributes:
kibana:
version: '3'
nginx:
listen_http: 8080
install_method: 'source'
- name: kibana4
run_list:
- 'recipe[kibana]'
- 'recipe[apache2]'
- 'recipe[kibana::apache]'
- 'recipe[java]'
- 'recipe[elasticsearch]'
attributes:
apache:
listen_ports:
- 8080
kibana:
version: '4'
apache:
port: 8080
- name: kibana4_nginx
run_list:
- 'recipe[kibana]'
- 'recipe[nginx]'
- 'recipe[kibana::nginx]'
- 'recipe[java]'
- 'recipe[elasticsearch]'
attributes:
kibana:
version: '4'
nginx:
listen_http: 8080
- name: kibana4_source
run_list:
- 'recipe[kibana]'
attributes:
kibana:
version: '4'
install_method: 'source'
6 changes: 4 additions & 2 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
site :opscode
source 'https://api.berkshelf.com/'

metadata

group :vagrant do
cookbook 'apt'
cookbook 'apt'
cookbook 'apache2'
cookbook 'nginx'
cookbook 'java'
cookbook 'elasticsearch'
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v0.1.10:
* Support proxying elasticsearch through apache. Submitted by Dmitry (cyberflow).
* Replace depends with suggest for the apache cookbook as it is not needed when using nginx. Submitted by Bryan Casey.
* Correct apache configuration to work with apache < 2.4. Submitted by Olivier Dolbeau (odolbeau).

## v0.1.8:
* nginx support. Submitted by Gregoire Seux and Jonathon W. Marshall.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group :test do
gem 'test-kitchen', '~> 1.0.0'
gem 'kitchen-vagrant', '~> 0.11'
gem 'foodcritic', '~> 3.0.3'
gem 'rubocop', '~> 0.15.0'
gem 'rubocop', '~> 0.23.0'
gem 'chefspec', '~> 3.0'
end

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req

* build-essential
* ark
* apache2 (>= 2.0)
* apache2 (>= 2.0) (Suggested but not required)
* authbind (Suggested but not required)
* apt (Suggested but not required)
* nginx (Suggested but not required)
Expand Down Expand Up @@ -51,11 +51,15 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req
* `node['kibana']['apache']['basic_auth_username']` - Apache http auth username. Defaults to `admin`.
* `node['kibana']['apache']['basic_auth_password']` - Apache http auth password. Defaults to `PLEASEchangeme`.
* `node['kibana']['apache']['port']` - The port on which to bind apache. Defaults to `80`.
* `node['kibana']['apache']['proxy']` - Boolean switch to enable apache search query proxy. Defaults to `false`.
* `node['kibana']['nginx']['port']` - The port on which to bind nginx. Defaults to `80`.
* `node['kibana']['nginx']['listen_http']` - The port on which to bind nginx. Defaults to `80`.
* `node['kibana']['nginx']['listen_https']` - The HTTPS port on which to bind nginx. Defaults to `443`.
* `node['kibana']['nginx']['client_max_body']` - Defaults to `50M`.
* `node['kibana']['nginx']['ssl']` - Boolean switch to enable SSL configuration. Defaults to `false`.
* `node['kibana']['nginx']['proxy']` - Boolean switch to enable nginx search query proxy. Defaults to `false`.
* `node['kibana']['nginx']['auth']` - Boolean switch to enable auth basic. Defaults to `false`.
* `node['kibana']['auth_file']` - The path to auth basic file. Defaults to `/etc/nginx/htpasswd.users`.
* `node['kibana']['nginx']['ssl_certificate']` - The path to the SSL certificate file. Defaults to `nil`.
* `node['kibana']['nginx']['ssl_certificate_key']` - The path to the SSL certificate key. Defaults to `nil`.
* `node['kibana']['nginx']['ssl_protocols']` - The SSL protocols. Defaults to `TLSv1 TLSv1.1 TLSv1.2`.
Expand All @@ -70,6 +74,7 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req
* [kibana::default](#kibanadefault) - Install Kibana.
* kibana::kibana2
* kibana::kibana3
* kibana::kibana4
* kibana::nginx

## kibana::apache
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require 'rake/testtask'
require 'rainbow/ext/string'
require 'rubocop/rake_task'
desc 'Run RuboCop on the lib directory'
Rubocop::RakeTask.new(:rubocop) do |task|
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = true
end

Expand All @@ -18,4 +18,4 @@ task :foodcritic do
sh 'foodcritic -f any -t ~FC007 .'
end

task default: [:rubocop, :foodcritic]
task default: [:rubocop, :foodcritic]
46 changes: 40 additions & 6 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Encoding: utf-8

#<> Kibana version
#<> Kibana major version
default['kibana']['version'] = '2'
#<> Kibana3 exact version
default['kibana']['kibana3_version'] = '3.0.0'
#<> Kibana4 exact version
default['kibana']['kibana4_version'] = '4.2.0'
#<> The base directory of kibana.
default['kibana']['base_dir'] = '/opt/kibana'
#<> The user under which Kibana is installed.
Expand All @@ -12,10 +14,15 @@
default['kibana']['group'] = 'kibana'
#<> Install method. Can be source or release
default['kibana']['install_method'] = 'release'

url_version = node['kibana']["kibana#{node['kibana']['version']}_version"] || node['kibana']['version']
#<> Url of tarball
default['kibana']['url'] = "https://download.elasticsearch.org/kibana/kibana/kibana-#{node['kibana']['kibana3_version']}.tar.gz"
default['kibana']['url'] = Kibana::Url.new(node, url_version).get
#<> Checksum of the tarball
default['kibana']['checksum'] = 'df25bc0cc02385edcac446ef8cbd83b896cdc910a0fa1b0a7bd2a958164593a8'
#<> Checksum of the tarball (for Kibana4)
default['kibana']['kibana4_checksum'] = '67d586e43a35652adeb6780eaa785d3d785ce60cc74fbf3b6a9a53b753c8f985'

#<> The URL to Kibana repository.
default['kibana']['git']['url'] = if node['kibana']['version'] > '2'
'https://github.com/elasticsearch/kibana.git'
Expand All @@ -32,20 +39,28 @@
default['kibana']['rubyversion'] = '1.9.1'

#<> The interface on which to bind.
default['kibana']['interface'] = node['ipaddress']
default['kibana']['interface'] = '127.0.0.1'

#<> The port on which to bind.
default['kibana']['port'] = 5601
#<> An Array of the elasticsearch service hosts.
default['kibana']['elasticsearch']['hosts'] = ['127.0.0.1']
#<> The port of the elasticsearch http service.
default['kibana']['elasticsearch']['port'] = 9200

default['kibana']['index'] = if node['kibana']['version'] > '3'
'.kibana'
else
'kibana-int'
end

#<> The which fields are shown by default.
default['kibana']['default_fields'] = '["@message"]'
#<> The operator used if no explicit operator is specified.
default['kibana']['default_operator'] = 'OR'
#<> The cookbook from which config.js template is taken
#<> The cookbook from which configuration template is taken
default['kibana']['config']['cookbook'] = nil
#<> The template from which config.js is generated from
#<> The template from which configuration is generated from
default['kibana']['config']['source'] = nil
#<> Fields specifiers which default to @message (may need to be changed for newer logstash)
default['kibana']['highlighted_field'] = '@message'
Expand All @@ -65,7 +80,10 @@
#<> The port on which to bind apache.
default['kibana']['apache']['port'] = 80
#<> Boolean switch to enable apache search query proxy
default['kibana']['apache']['port'] = false
default['kibana']['apache']['proxy'] = false
#<> The apache configuration source
default['kibana']['apache']['cookbook'] = 'kibana'

#<> The port on which to bind nginx
default['kibana']['nginx']['port'] = 80

Expand Down Expand Up @@ -105,3 +123,19 @@
default['kibana']['nginx']['server_name'] = 'kibana'

default['kibana']['elasticsearch_host'] = ''

#<> The nginx configuration source
default['kibana']['nginx']['cookbook'] = 'kibana'

#<> Redirect requests to kibana service
default['kibana']['kibana_service'] = nil
unless node['kibana']['version'] =~ /^3/
default['kibana']['kibana_service'] = "http://#{node['kibana']['interface']}:#{node['kibana']['port']}"
end

#<> The kibana service configuration source
default['kibana']['service']['source'] = 'upstart.conf.erb'
default['kibana']['service']['cookbook'] = 'kibana'

#<> The kibana 4 default application on load
default['kibana']['defaultapp'] = 'discover'
41 changes: 41 additions & 0 deletions libraries/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Encoding: utf-8

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.elastic.co/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
12 changes: 7 additions & 5 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Encoding: utf-8

name 'kibana'
maintainer 'Peter Donald'
name 'kibana'
maintainer 'Peter Donald'
maintainer_email 'peter@realityforge.org'
license 'Apache 2.0'
description 'Installs/Configures kibana, the logstash UI'
license 'Apache 2.0'
description 'Installs/Configures kibana, the logstash UI'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.9'
version '0.1.9'

depends 'build-essential'
depends 'ark'
suggests 'apache2', '>= 2.0'
suggests 'authbind'
suggests 'apt'
suggests 'nginx'
suggests 'java'
suggests 'elasticsearch'
18 changes: 18 additions & 0 deletions recipes/_service.rb
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
7 changes: 7 additions & 0 deletions recipes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@
owner node['apache']['user']
group node['apache']['group']
mode 00644
not_if { node['kibana']['apache']['basic_auth'] == 'off' }
end

template "#{node['apache']['dir']}/sites-available/kibana.conf" do
variables(
'index' => node['kibana']['index'],
'kibana_service' => node['kibana']['kibana_service']
)
source 'vhost.conf.erb' if node['kibana']['version'] =~ /^2/
source 'vhost3.conf.erb' if node['kibana']['version'] =~ /^3/
source 'vhost4.conf.erb' if node['kibana']['version'] =~ /^4/
cookbook node['kibana']['apache']['cookbook']
owner node['apache']['user']
group node['apache']['group']
mode 00644
Expand Down
2 changes: 1 addition & 1 deletion recipes/kibana2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

#gem1.8 doesn't get brought in with ruby1.8.x
if node['kibana']['rubyversion'] == '1.8'
if node['kibana']['rubyversion'] == '1.8'
package "rubygems#{node['kibana']['rubyversion']}"
end

Expand Down
5 changes: 3 additions & 2 deletions recipes/kibana3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@

template File.join(node['kibana']['base_dir'], config_path) do
cookbook node['kibana']['config']['cookbook']
source node['kibana']['config']['source']
source node['kibana']['config']['source']
owner node['kibana']['user']
group node['kibana']['group']
mode '0644'
variables({
:es_port => node['kibana']['elasticsearch']['port'],
:elasticsearch_host => node['kibana']['elasticsearch_host']
:elasticsearch_host => node['kibana']['elasticsearch_host'],
:index => node['kibana']['index']
})
end
Loading