Craig Bryant 921642edb8 Get initial build to work.
Add .gitreview, Gemfile, .rubocop.yml, Berksfile, Strainerfile

Fixed style errors.

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

Change-Id: Ifac43dd25c20f67cbd699f50e01c4e157342e87d
2014-07-16 15:41:12 -06:00

28 lines
685 B
Ruby

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