forked from anuriq/chef-kibana5
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Vrinceanu Catalin
committed
Feb 8, 2018
1 parent
070b634
commit c926357
Showing
3 changed files
with
61 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
## 1.4.0 (8 Feb, 2018) | ||
- Add plugin resource; | ||
|
||
## 1.3.2 (8 Feb, 2018) | ||
- Add version 5.6.7 of Kibana; | ||
|
||
|
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,57 @@ | ||
# | ||
# Cookbook:: kibana5 | ||
# Resource:: kibana5_plugins | ||
# | ||
# Copyright:: 2017, Parallels International GmbH | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
resource_name :kibana5_plugins | ||
|
||
property :name, String, name_property: true | ||
property :install_type, String, default: 'native' | ||
property :url, String, default: '' | ||
|
||
default_action :install | ||
|
||
action :install do | ||
|
||
service 'kibana' do | ||
action :nothing | ||
end | ||
|
||
case new_resource.install_type | ||
when 'native' | ||
ex = execute "Install #{new_resource.name} Kibana plugin" do | ||
command "./kibana-plugin install #{new_resource.name}" | ||
user node['kibana5']['service_user'] | ||
group node['kibana5']['service_group'] | ||
cwd "/opt/kibana/#{node['kibana5']['version']}/current/bin" | ||
notifies :restart, "service[kibana]" | ||
not_if "/opt/kibana/#{node['kibana5']['version']}/current/bin/kibana-plugin list | grep #{new_resource.name}" | ||
end | ||
new_resource.updated_by_last_action(ex.updated_by_last_action?) | ||
when 'url' | ||
ex = execute "Install #{new_resource.name} Kibana plugin" do | ||
command "./kibana-plugin install #{new_resource.url}" | ||
user node['kibana5']['service_user'] | ||
group node['kibana5']['service_group'] | ||
cwd "/opt/kibana/#{node['kibana5']['version']}/current/bin" | ||
notifies :restart, "service[kibana]" | ||
not_if "/opt/kibana/#{node['kibana5']['version']}/current/bin/kibana-plugin list | grep #{new_resource.name}" | ||
end | ||
new_resource.updated_by_last_action(ex.updated_by_last_action?) | ||
else | ||
Chef::Application.fatal!("Unknown install type: #{new_resource.install_type}") | ||
end | ||
end |