Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runit #6

Merged
merged 10 commits into from
Jul 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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