cookbook-monasca-thresh/recipes/default.rb
Craig Bryant 4adbd6cd57 Changed mon to monasca everywhere
Changed mon-thresh to monasca-thresh

Changed mon_thresh to monasca_thresh in databags

Put config file in /etc/monasca

Change to use the monasca-thresh deb

This will not work without corresponding changes to monasca-vagrant

Change-Id: I3ea41c982f9fa522c777f3832198deac8cba9655
2014-08-07 10:47:27 -06:00

28 lines
705 B
Ruby

# encoding: UTF-8
#
# The user/group thresh are created by the package, as well as /etc/monasca/
package 'monasca-thresh' do # The package depends on openjdk-7-jre-headless
action :upgrade
end
service 'monasca-thresh' do
action :enable
end
# TODO: an encrypted credentials data bag
credentials = { 'mysql' => { 'user' => 'thresh', 'password' => 'password' } }
settings = data_bag_item(node[:monasca_thresh][:data_bag], 'monasca_thresh')
template '/etc/monasca/thresh-config.yml' do
action :create
owner 'root'
group 'thresh'
mode '640'
source 'thresh-config.yml.erb'
variables(
credentials: credentials,
settings: settings
)
notifies :restart, 'service[monasca-thresh]'
end