From 16db016d14022036e885a2dc3ae605722e6b69c8 Mon Sep 17 00:00:00 2001 From: Jacob Dearing Date: Fri, 31 Jul 2015 16:43:37 -0500 Subject: [PATCH] support Chef 11 --- .kitchen.yml | 2 +- README.md | 2 +- libraries/provider_elasticsearch.rb | 2 +- libraries/provider_kibana.rb | 2 +- libraries/provider_logstash.rb | 2 +- libraries/provider_logstash_forwarder.rb | 3 ++- libraries/resource_elasticsearch.rb | 2 -- metadata.rb | 2 +- test/cookbooks/elktest/recipes/default.rb | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index d020f8a..ac04251 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -12,7 +12,7 @@ platforms: provisioner: name: chef_zero - require_chef_omnibus: '12.4.1' + require_chef_omnibus: '11' data_bags_path: 'test/integration/data_bags' suites: diff --git a/README.md b/README.md index dadecdd..4ebf9d7 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ centos66 Requirements ------------ -- chef 12 +- chef 11+ - some kind of java - see [metadata](/metadata.rb) for complexity diff --git a/libraries/provider_elasticsearch.rb b/libraries/provider_elasticsearch.rb index b825776..1828ae5 100644 --- a/libraries/provider_elasticsearch.rb +++ b/libraries/provider_elasticsearch.rb @@ -5,7 +5,7 @@ class Elasticsearch < Chef::Provider::LWRPBase use_inline_resources if defined?(use_inline_resources) - provides :elasticsearch + # provides :elasticsearch service_name = 'elasticsearch' diff --git a/libraries/provider_kibana.rb b/libraries/provider_kibana.rb index 8b6c7b8..f77953e 100644 --- a/libraries/provider_kibana.rb +++ b/libraries/provider_kibana.rb @@ -3,7 +3,7 @@ class Provider class Kibana < Chef::Provider::LWRPBase use_inline_resources if defined?(use_inline_resources) - provides :kibana + # provides :kibana service_name = 'kibana' diff --git a/libraries/provider_logstash.rb b/libraries/provider_logstash.rb index 8b14a77..0276e2e 100644 --- a/libraries/provider_logstash.rb +++ b/libraries/provider_logstash.rb @@ -3,7 +3,7 @@ class Provider class Logstash < Chef::Provider::LWRPBase use_inline_resources if defined?(use_inline_resources) - provides :logstash + # provides :logstash service_name = 'logstash' action :install do diff --git a/libraries/provider_logstash_forwarder.rb b/libraries/provider_logstash_forwarder.rb index 8630cfb..0cbed79 100644 --- a/libraries/provider_logstash_forwarder.rb +++ b/libraries/provider_logstash_forwarder.rb @@ -3,7 +3,8 @@ class Provider class LogstashForwarder < Chef::Provider::LWRPBase use_inline_resources if defined?(use_inline_resources) - provides :logstash_forwarder + # provides :logstash_forwarder + service_name = 'logstash-forwarder' action :install do diff --git a/libraries/resource_elasticsearch.rb b/libraries/resource_elasticsearch.rb index de21cae..c7c1bf2 100644 --- a/libraries/resource_elasticsearch.rb +++ b/libraries/resource_elasticsearch.rb @@ -7,8 +7,6 @@ class Elasticsearch < Chef::Resource::LWRPBase default_action :install actions [:install, :remove, :enable, :disable, :restart, :start, :stop] - require 'chef/resource' - # used to target any files/templates; default to self attribute :source, kind_of: String, default: 'elk' diff --git a/metadata.rb b/metadata.rb index 6290e17..627b4fc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'MIT' description 'Installs/Configures ELK' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.2.0' +version '0.2.1' supports 'centos' diff --git a/test/cookbooks/elktest/recipes/default.rb b/test/cookbooks/elktest/recipes/default.rb index a5540cc..71a6e40 100644 --- a/test/cookbooks/elktest/recipes/default.rb +++ b/test/cookbooks/elktest/recipes/default.rb @@ -1,5 +1,5 @@ # test a single node with all four projects -%w( tar nano htop java-1.8.0-openjdk-headless).each do |pkg| +%w( tar nano htop java-1.8.0-openjdk-headless ).each do |pkg| package pkg end