Skip to content

Commit

Permalink
Merge pull request #6 from dearing/runit
Browse files Browse the repository at this point in the history
Runit
  • Loading branch information
dearing committed Jul 28, 2015
2 parents 2e8dbfe + ba1b229 commit 793ad7f
Showing 56 changed files with 657 additions and 1,874 deletions.
11 changes: 8 additions & 3 deletions .kitchen.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
driver_plugin: vagrant
#driver:
# name: docker
# dockerfile: test/Dockerfile-centos66
# provision_command: curl -L http://www.chef.io/chef/install.sh | bash

driver_config:
publish_all: true

platforms:
- name: centos-6.6

provisioner:
name: chef_zero
require_chef_omnibus: '12.4.0'
require_chef_omnibus: '12.4.1'
data_bags_path: 'test/integration/data_bags'

suites:
- name: default
run_list:
- recipe[elktest]
- recipe[elktest]
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
source 'https://rubygems.org'

gem 'berkshelf'

group :integration do
gem 'test-kitchen'
gem 'kitchen-docker'
end
17 changes: 1 addition & 16 deletions libraries/helpers.rb
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
require 'chef'

module Elasticsearch
module Helpers
end
end

module Logstash
module Helpers
end
end

module LogstashForwarder
module Helpers
end
end

module Kibana
module ELK
module Helpers
end
end
82 changes: 82 additions & 0 deletions libraries/provider_elasticsearch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
class Chef
class Provider
class Elasticsearch < Chef::Provider::LWRPBase
include ELK::Helpers

use_inline_resources if defined?(use_inline_resources)

provides :elasticsearch

service_name = 'elasticsearch'

action :install do
home_dir = "#{new_resource.path}/elasticsearch-#{new_resource.version}"

user new_resource.user
group new_resource.group

ark service_name do
checksum new_resource.checksum
group new_resource.group
has_binaries new_resource.has_binaries
owner new_resource.user
prefix_root new_resource.path
url new_resource.url
version new_resource.version
end

runit_service service_name do
default_logger true
owner new_resource.user
group new_resource.group
cookbook new_resource.source
env new_resource.runit_env
options new_resource.runit_options.merge(
'home_dir' => home_dir,
'user' => new_resource.user,
'group' => new_resource.group
)
action [:create, :enable]
end
end

action :remove do
service service_name do
action :stop
end
end

## SERVICES

action :enable do
service service_name do
action :enable
end
end

action :disable do
service service_name do
action :disable
end
end

action :start do
service service_name do
action :start
end
end

action :stop do
service service_name do
action :stop
end
end

action :restart do
service service_name do
action :restart
end
end
end
end
end
76 changes: 0 additions & 76 deletions libraries/provider_elasticsearch_config.rb

This file was deleted.

73 changes: 0 additions & 73 deletions libraries/provider_elasticsearch_service.rb

This file was deleted.

Loading

0 comments on commit 793ad7f

Please sign in to comment.