Skip to content

Commit

Permalink
Merge pull request #18 from dearing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dearing committed Aug 1, 2015
2 parents e363123 + f68b875 commit 54a4ebe
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ metadata

group :integration do
cookbook 'elktest', path: './test/cookbooks/elktest'
cookbook 'runit', '~> 1.7.2'
# until https://github.com/hw-cookbooks/runit/issues/142
cookbook 'runit', '~> 1.5.18'
# cookbook 'runit', git: "https://github.com/hw-cookbooks/runit.git", ref: "dev"
end
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ elk CHANGELOG
This file is used to list changes made in each version of the elk cookbook.


0.2.4
-----
- Jacob Dearing - Kibana looling more Release-Ready :+1:

0.2.4
-----
- Jacob Dearing - Logstash kinda Release-Ready :+1:
Expand Down
6 changes: 4 additions & 2 deletions libraries/provider_kibana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Kibana < Chef::Provider::LWRPBase
service_name = 'kibana'

action :install do
home_dir = "#{new_resource.path}/kibana-#{new_resource.version}"
user new_resource.user do
system true
shell '/sbin/nologin'
Expand All @@ -23,17 +24,17 @@ class Kibana < Chef::Provider::LWRPBase
prefix_root new_resource.path
url new_resource.url
version new_resource.version
notifies :restart, "runit_service[#{service_name}]", :delayed
end

home_dir = "#{new_resource.path}/kibana-#{new_resource.version}"

template "#{home_dir}/config/kibana.yml" do
source 'kibana/kibana.yml.erb'
owner new_resource.user
owner new_resource.group
mode '0644'
cookbook new_resource.source
variables options: {
'ca' => new_resource.ca,
'default_app_id' => new_resource.default_app_id,
'elasticsearch_preserve_host' => new_resource.elasticsearch_preserve_host,
'elasticsearch_url' => new_resource.elasticsearch_url,
Expand All @@ -56,6 +57,7 @@ class Kibana < Chef::Provider::LWRPBase
'user' => new_resource.user,
'verify_ssl' => new_resource.verify_ssl
}
notifies :restart, "runit_service[#{service_name}]", :delayed
end

# RUNIT
Expand Down
1 change: 1 addition & 0 deletions libraries/resource_kibana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Kibana < Chef::Resource::LWRPBase
default_action :install
actions [:install, :remove, :enable, :disable, :restart, :start, :stop]

attribute :ca, kind_of: String, default: nil
attribute :checksum, kind_of: String, default: '6f42d25f337fd49f38e2af81b9ab6e0c987a199a8c0b2e1410d072f812cb4520'
attribute :default_app_id, kind_of: String, default: 'discover'
attribute :elasticsearch_host, kind_of: String, default: '127.0.0.1'
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'MIT'
description 'Installs/Configures ELK'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.2.4'
version '0.2.5'

supports 'centos'

Expand Down
22 changes: 11 additions & 11 deletions templates/default/kibana/kibana.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ kibana_index: <%= @options['kibana_index'] %>
# 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: <%= @options['kibana_elasticsearch_username'] %>
# kibana_elasticsearch_password: <%= @options['kibana_elasticsearch_password'] %>
<%= "kibana_elasticsearch_username: #{ @options['kibana_elasticsearch_username']}" if @options['kibana_elasticsearch_username'] -%>
<%= "kibana_elasticsearch_password: #{ @options['kibana_elasticsearch_password']}" if @options['kibana_elasticsearch_password'] %>

# If your Elasticsearch requires client certificate and key
# kibana_elasticsearch_client_crt: <%= @options['kibana_elasticsearch_client_crt'] %>
# kibana_elasticsearch_client_key: <%= @options['kibana_elasticsearch_client_key'] %>
<%= "kibana_elasticsearch_client_crt: #{ @options['kibana_elasticsearch_client_crt']}" if @options['kibana_elasticsearch_client_crt'] -%>
<%= "kibana_elasticsearch_client_key: #{ @options['kibana_elasticsearch_client_key']}" if @options['kibana_elasticsearch_client_key'] -%>

# 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
<%= "ca: #{ @options['ca']}" if @options['ca'] -%>

# The default application to load.
default_app_id: <%= @options['default_app_id'] %>

# Time in milliseconds to wait for elasticsearch to respond to pings, defaults to
# request_timeout setting
# ping_timeout: <%= @options['ping_timeout'] %>
<%= "ping_timeout: #{ @options['ping_timeout']}" if @options['ping_timeout'] -%>

# Time in milliseconds to wait for responses from the back end or elasticsearch.
# This must be > 0
Expand All @@ -49,22 +49,22 @@ request_timeout: <%= @options['request_timeout'] %>
shard_timeout: <%= @options['shard_timeout'] %>

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying
# startup_timeout: <%= @options['elasticsearch_url'] %>
<%= "startup_timeout: #{ @options['startup_timeout']}" if @options['startup_timeout'] -%>

# Set to false to have a complete disregard for the validity of the SSL
# certificate.
verify_ssl: <%= @options['verify_ssl'] %>

# SSL for outgoing requests from the Kibana Server (PEM formatted)
# ssl_key_file: <%= @options['ssl_key_file'] %>
# ssl_cert_file: <%= @options['ssl_cert_file'] %>
<%= "ssl_key_file: #{ @options['ssl_key_file']}" if @options['ssl_key_file'] -%>
<%= "ssl_cert_file: #{ @options['ssl_cert_file']}" if @options['ssl_cert_file'] -%>

# Set the path to where you would like the process id file to be created.
# pid_file: <%= @options['pid_file'] %>
<%= "pid_file: #{ @options['pid_file']}" if @options['pid_file'] -%>

# 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.
# log_file: <%= @options['log_file'] %>
<%= "log_file: #{ @options['log_file']}" if @options['log_file'] -%>

# Plugins that are included in the build, and no longer found in the plugins/ folder
bundled_plugin_ids:
Expand Down
4 changes: 3 additions & 1 deletion test/cookbooks/elktest/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@
files [{ 'paths' => ['/var/log/messages', '/var/log/*log', '/var/log/kibana/current'], 'fields' => { 'type' => 'syslog' } }]
end

kibana 'default'
kibana 'default' do
port 8080
end

0 comments on commit 54a4ebe

Please sign in to comment.