Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #110 from realityforge/prep-release
Browse files Browse the repository at this point in the history
Prep release
  • Loading branch information
mburns committed Mar 16, 2018
2 parents 256fa1c + 31331f9 commit 9b100d1
Show file tree
Hide file tree
Showing 38 changed files with 114 additions and 75 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ LeadingCommentSpace:

LineLength:
Enabled: false

Style/FileName:
Exclude:
- 'Berksfile'
- 'Gemfile'
- 'Vagrantfile'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.3.0
ruby-2.3.5
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.3.0
- 2.3.5

sudo: required
services: docker
Expand Down
19 changes: 11 additions & 8 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# frozen_string_literal: true

source 'https://supermarket.chef.io/'

metadata

group :vagrant do
cookbook 'ark', '= 2.2.1'
cookbook 'apt'
cookbook 'apache2'
cookbook 'elasticsearch', '~ 2.4.0'
cookbook 'java'
cookbook 'ohai'
cookbook 'netstat'
cookbook 'chef_nginx', '~ 2.9.0'
cookbook 'ark', '>= 2.2.1'
cookbook 'apt'
cookbook 'apache2'
cookbook 'build-essential'
cookbook 'elasticsearch', '~ 2.4.0'
cookbook 'java'
cookbook 'netstat'
cookbook 'ohai'
cookbook 'chef_nginx', '~ 2.9.0'
end
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.2.2:
* Update to fix travis runs for CentOS7 and Ubuntu 16.04. #102 (@drenalin23)
* Update `ark` #103 (@drenalin23)
* `kibana_plugin` resource to manage plugins #106 (@InformatiQ)
* Kibana5, Amazon Linux fixes #107 (@InformatiQ)
* switch `node['kibana']['version']` to integer #109 (@InformatiQ)
* Lint fixes #104 (@drenalin23)

## 0.2.1:
* fix issue with bin_path for package installs (@drenalin23)
* update the nginx source attribute so it is easier to override in wrapper cookbooks (@drenalin23)
Expand Down
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'berkshelf'
gem 'stove'

group :test do
gem 'rake'
gem 'test-kitchen'
gem 'buff-extensions'
gem 'chefspec'
gem 'foodcritic'
gem 'rake'
gem 'rubocop'
gem 'chefspec'
gem 'buff-extensions'
gem 'test-kitchen'
end

group :vagrant do
gem 'kitchen-vagrant'
end

group :development do
gem 'knife-cookbook-doc'
gem 'kitchen-openstack'
gem 'kitchen-transport-rsync'
gem 'knife-cookbook-doc'
end

group :integration_docker do
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req

## Platform:

* Ubuntu 12.04, 14.04.
* Ubuntu 14.04, 16.04
* CentOS 6, 7

## Cookbooks:
Expand All @@ -33,7 +33,7 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req
* `node['kibana']['base_dir']` - The base directory of kibana. Defaults to `/opt/kibana`.
* `node['kibana']['user']` - The user under which Kibana is installed. Defaults to `kibana`.
* `node['kibana']['group']` - The group under which Kibana is installed. Defaults to `kibana`.
* `node['kibana']['install_method']` - Install method. Can be source or release. Defaults to `release`.
* `node['kibana']['install_method']` - Install method. Can be `package` or `release`. Defaults to `release`.
* `node['kibana']['url']` - Url of tarball. Defaults to `https://download.elasticsearch.org/kibana/kibana/kibana-#{node['kibana']['kibana3_version']}.tar.gz`.
* `node['kibana']['kibana3_checksum']` - Checksum of the tarball.
* `node['kibana']['kibana4_checksum']` - Checksum of the tarball.
Expand Down Expand Up @@ -81,6 +81,7 @@ Kibana requires ElasticSearch index to be configured to work as per logstash req
* [kibana::default](#kibanadefault) - Install Kibana.
* kibana::kibana3
* kibana::kibana4
* kibana::kibana5
* kibana::nginx

## kibana::apache
Expand Down Expand Up @@ -139,6 +140,6 @@ end

# License and Maintainers

Maintainers:: Peter Donald (<[email protected]>), Dimitry Ryobryshkin (@cyberflow), Scott Nelson Windels (<[email protected]>)
Maintainers:: Peter Donald (<[email protected]>), Dimitry Ryobryshkin (@cyberflow), Scott Nelson Windels (<[email protected]>), Michael Burns (@mburns)

License:: Apache 2.0
15 changes: 10 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Encoding: utf-8
# frozen_string_literal: true

require 'rake'
require 'rake/testtask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/setup'
require 'foodcritic'

require 'stove/rake_task'
Stove::RakeTask.new
Expand All @@ -15,9 +15,14 @@ RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = true
end

desc 'Foodcritic linter'
task :foodcritic do
sh 'foodcritic -f any -t ~FC007 .'
FoodCritic::Rake::LintTask.new do |t|
t.options = {
fail_tags: ['any'],
tags: [
'~FC007', # Don't reflect recipe dependencies
'~FC071' # Don't require LICENSE file
]
}
end

desc 'Run Test Kitchen integration tests'
Expand Down Expand Up @@ -50,4 +55,4 @@ RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = 'test/unit/spec/*_spec.rb'
end

task default: [:rubocop, :foodcritic, :unit]
task default: %i[rubocop foodcritic unit]
28 changes: 15 additions & 13 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# frozen_string_literal: true

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
Vagrant.configure('2') do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

config.vm.hostname = "kibana"
config.vm.hostname = 'kibana'

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "opscode-precise64"
config.vm.box = 'opscode-precise64'

# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box"
config.vm.box_url = 'https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box'

config.omnibus.chef_version = '11.6.2'
config.omnibus.chef_version = '12.7.2'

# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
config.vm.network :private_network, ip: "33.33.33.10"
config.vm.network :private_network, ip: '33.33.33.10'

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
Expand Down Expand Up @@ -57,7 +59,7 @@ Vagrant.configure("2") do |config|
# information on available options.

# The path to the Berksfile to use with Vagrant Berkshelf
config.berkshelf.berksfile_path = "./Berksfile"
config.berkshelf.berksfile_path = './Berksfile'

# Enabling the Berkshelf plugin. To enable this globally, add this configuration
# option to your ~/.vagrant.d/Vagrantfile file
Expand All @@ -73,17 +75,17 @@ Vagrant.configure("2") do |config|

config.vm.provision :chef_solo do |chef|
chef.json = {
"kibana" => {
"apache" => {
"basic_auth" => 'on'
'kibana' => {
'apache' => {
'basic_auth' => 'on'
}
}
}

chef.run_list = [
"recipe[apt::default]",
"recipe[kibana::default]",
"recipe[kibana::apache]"
'recipe[apt::default]',
'recipe[kibana::default]',
'recipe[kibana::apache]'
]
end
end
3 changes: 1 addition & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

#<> Kibana major version
Expand All @@ -7,7 +6,7 @@
#<> Kibana3 exact version
default['kibana']['kibana3_version'] = '3.1.2'
default['kibana']['kibana3_checksum'] = '480562733c2c941525bfa26326b6fae5faf83109b452a6c4e283a5c37e3086ee'
default['kibana']['kibana3_url'] = 'https://download.elastic.co/kibana/kibana/kibana-3.1.2.tar.gz'
default['kibana']['kibana3_url'] = "https://download.elastic.co/kibana/kibana/kibana-#{node['kibana']['kibana3_version']}.tar.gz"

#<> Kibana4 exact version
default['kibana']['kibana4_version'] = '4.6.6'
Expand Down
1 change: 0 additions & 1 deletion libraries/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

class Kibana
Expand Down
8 changes: 5 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Encoding: utf-8
# frozen_string_literal: true

name 'kibana'
maintainer 'Peter Donald'
maintainer_email '[email protected]'
license 'Apache 2.0'
license 'Apache-2.0'
description 'Installs/Configures kibana, the logstash UI'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.2.1'
version '0.2.2'
source_url 'https://github.com/realityforge/chef-kibana'
issues_url 'https://github.com/realityforge/chef-kibana/issues'

chef_version '>= 12' if respond_to?(:chef_version)

supports 'ubuntu'
supports 'debian'
supports 'centos'

depends 'build-essential'
depends 'ark'
Expand Down
3 changes: 1 addition & 2 deletions recipes/_service.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

template node['kibana']['service']['template_file'] do
Expand All @@ -17,5 +16,5 @@
service 'kibana' do
provider node['kibana']['service']['provider']
supports start: true, restart: true, stop: true, status: true
action [:enable, :start]
action %i[enable start]
end
1 change: 0 additions & 1 deletion recipes/apache.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

=begin
Expand Down
1 change: 0 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

=begin
Expand Down
1 change: 0 additions & 1 deletion recipes/kibana3.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

include_recipe 'kibana'
Expand Down
5 changes: 2 additions & 3 deletions recipes/kibana4.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Encoding: utf-8
# frozen_string_literal: true

include_recipe 'kibana'
Expand All @@ -15,11 +14,11 @@
config_path = 'current/config/kibana.yml'
elsif node['kibana']['install_method'] == 'package'
node.default['kibana']['service']['bin_path'] = 'bin'
if node.platform_family? 'debian'
if platform_family? 'debian'
apt_repository 'kibana' do
uri node['kibana']['repository_url']
distribution ''
components %w(stable main)
components %w[stable main]
key node['kibana']['repository_key']
end
else
Expand Down
6 changes: 3 additions & 3 deletions recipes/kibana5.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Encoding: utf-8
# frozen_string_literal: true

include_recipe 'kibana'

Expand All @@ -14,11 +14,11 @@
config_path = 'current/config/kibana.yml'
elsif node['kibana']['install_method'] == 'package'
node.default['kibana']['service']['bin_path'] = 'bin'
if node.platform_family? 'debian'
if platform_family? 'debian'
apt_repository 'kibana' do
uri node['kibana']['repository_url']
distribution ''
components %w(stable main)
components %w[stable main]
key node['kibana']['repository_key']
end
else
Expand Down
2 changes: 1 addition & 1 deletion recipes/nginx.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Encoding: utf-8
# frozen_string_literal: true

include_recipe 'chef_nginx'

template File.join(node['nginx']['dir'], 'sites-available', 'kibana') do
Expand Down
9 changes: 5 additions & 4 deletions resources/plugin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

resource_name :kibana_plugin

property :name, String, name_property: true
property :url, String
property :kibana_home, String, default: ::File.join(node['kibana']['base_dir'], 'current')
property :plugins_registry, String, default: ::File.join(node['kibana']['base_dir'], 'installedPugins.json')
Expand All @@ -17,7 +18,7 @@

def plugin_exists?(name)
list_arg = node['kibana']['version'] > 4 ? 'bin/kibana-plugin list' : 'bin/kibana plugin -l'
cmd_line = "#{list_arg}"
cmd_line = list_arg.to_s
cmd = Mixlib::ShellOut.new(cmd_line, cwd: kibana_home)
cmd.run_command
cmd.stdout.include? name
Expand All @@ -36,7 +37,7 @@ def update_plugin_reg(action)

action :install do
install_arg = node['kibana']['version'] > 4 ? "bin/kibana-plugin install #{url}" : "bin/kibana plugin -i #{name} -u #{url}"
plugin_install = "#{install_arg}"
plugin_install = install_arg.to_s
execute 'plugin-install' do
cwd kibana_home
command plugin_install
Expand All @@ -47,7 +48,7 @@ def update_plugin_reg(action)

action :remove do
remove_arg = node['kibana']['version'] > 4 ? "bin/kibana-plugin remove #{name}" : "bin/kibana plugin --remove #{name}"
plugin_remove = "#{remove_arg}"
plugin_remove = remove_arg.to_s
execute 'plugin-remove' do
cwd kibana_home
command plugin_remove
Expand Down
1 change: 1 addition & 0 deletions spec/support/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# matcher for install_ark
def install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/kibana3_apache/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Encoding: utf-8
# frozen_string_literal: true

require 'spec_helper'

describe 'kibana' do
Expand Down
Loading

0 comments on commit 9b100d1

Please sign in to comment.