cookbook-monasca-api/recipes/default.rb
Craig Bryant e3639c85f5 Get initial build to work.
Add .gitreview, Gemfile, .rubocop.yml, Berksfile, and Strainerfile.

Fixed style errors.

Added empty unit test so chef-unit passes until we get real unit tests.

Change-Id: I59d8567111c387b25dc215dc1309f03a1516ce3d
2014-07-17 10:06:12 -06:00

51 lines
1.0 KiB
Ruby

# encoding: UTF-8#
#
package 'mon-api' do
action :upgrade
end
service 'mon-api' do
action :enable
provider Chef::Provider::Service::Upstart
end
directory '/var/log/mon-api' do
recursive true
owner node[:mon_api][:owner]
group node[:mon_api][:group]
mode 0755
action :create
end
creds = data_bag_item(node[:mon_api][:data_bag], 'mon_credentials')
setting = data_bag_item(node[:mon_api][:data_bag], 'mon_api')
# Create the config file
template '/etc/mon/mon-api-config.yml' do
action :create
owner 'root'
group node[:mon_api][:group]
mode '640'
source 'mon-service-config.yml.erb'
variables(
creds: creds,
setting: setting
)
notifies :restart, 'service[mon-api]'
end
cookbook_file '/etc/ssl/hpmiddleware-keystore.jks' do
source 'hpmiddleware-keystore-production.jks'
owner 'root'
group node[:mon_api][:group]
mode '640'
end
cookbook_file '/etc/ssl/hpmiddleware-truststore.jks' do
source 'hpmiddleware-truststore.jks'
owner 'root'
group node[:mon_api][:group]
mode '640'
end