-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
277 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
class Chef | ||
class Provider | ||
class Logstash < Chef::Provider::LWRPBase | ||
use_inline_resources if defined?(use_inline_resources) | ||
|
||
provides :logstash | ||
|
||
service_name = 'logstash' | ||
|
||
action :install do | ||
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.user | ||
cookbook new_resource.source | ||
action [:create, :enable] | ||
end | ||
end | ||
|
||
action :remove do | ||
runit_service service_name do | ||
action :stop | ||
end | ||
end | ||
## SERVICE | ||
|
||
action :enable do | ||
service service_name do | ||
action :enable | ||
end | ||
end | ||
|
||
action :restart do | ||
service service_name do | ||
action :restart | ||
end | ||
end | ||
|
||
action :start do | ||
service service_name do | ||
action :start | ||
end | ||
end | ||
|
||
action :stop do | ||
service service_name do | ||
action :stop | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
class Chef | ||
class Provider | ||
class LogstashForwarder < Chef::Provider::LWRPBase | ||
use_inline_resources if defined?(use_inline_resources) | ||
|
||
provides :logstash_forwarder | ||
service_name = 'logstash_forwarder' | ||
|
||
action :install do | ||
user new_resource.user | ||
group new_resource.group | ||
|
||
# TODO: react to os/arch | ||
remote_file '/opt/bin/logstash-forwarder' do | ||
owner new_resource.user | ||
group new_resource.group | ||
mode '0755' | ||
source 'https://download.elastic.co/logstash-forwarder/binaries/logstash-forwarder_linux_amd64' | ||
checksum '5f49c5be671fff981b5ad1f8c5557a7e9973b24e8c73dbf0648326d400e6a4a1' | ||
end | ||
|
||
runit_service service_name do | ||
default_logger true | ||
owner new_resource.user | ||
group new_resource.user | ||
cookbook new_resource.source | ||
action [:create, :enable] | ||
end | ||
end | ||
|
||
action :remove do | ||
runit_service service_name do | ||
action :stop | ||
end | ||
end | ||
|
||
## SERVICE | ||
|
||
action :enable do | ||
service service_name do | ||
action :enable | ||
end | ||
end | ||
|
||
action :disable do | ||
service service_name do | ||
action :disable | ||
end | ||
end | ||
|
||
action :restart do | ||
service service_name do | ||
action :restart | ||
end | ||
end | ||
|
||
action :start do | ||
service service_name do | ||
action :start | ||
end | ||
end | ||
|
||
action :stop do | ||
service service_name do | ||
action :stop | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.