<commit_before>#
# Author:: <NAME> (<<EMAIL>>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
#
# All Rights Reserved
#

keepalived_dir = node['private_chef']['keepalived']['dir']
keepalived_etc_dir = File.join(keepalived_dir, "etc")
keepalived_bin_dir = File.join(keepalived_dir, "bin")
keepalived_log_dir = node['private_chef']['keepalived']['log_directory']

[ keepalived_dir, keepalived_etc_dir, keepalived_bin_dir, keepalived_log_dir ].each do |dir|
	directory dir do
		recursive true
		mode "0755"
	end
end

template File.join(keepalived_etc_dir, "keepalived.conf") do
	source "keepalived.conf.erb"
	mode "0644"
  variables(node['private_chef']['keepalived'].to_hash)
	notifies :restart, 'runit_service[keepalived]' if OmnibusHelper.should_notify?("kepalived")
end

template File.join(keepalived_bin_dir, "cluster.sh") do
	source "cluster.sh.erb"
	mode "0755"
  variables(node['private_chef']['keepalived'].to_hash)
end

component_runit_service "keepalived"<commit_msg>Restart keepalived when the list of services changes<commit_after>#
# Author:: <NAME> (<<EMAIL>>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
#
# All Rights Reserved
#

keepalived_dir = node['private_chef']['keepalived']['dir']
keepalived_etc_dir = File.join(keepalived_dir, "etc")
keepalived_bin_dir = File.join(keepalived_dir, "bin")
keepalived_log_dir = node['private_chef']['keepalived']['log_directory']

[ keepalived_dir, keepalived_etc_dir, keepalived_bin_dir, keepalived_log_dir ].each do |dir|
	directory dir do
		recursive true
		mode "0755"
	end
end

template File.join(keepalived_etc_dir, "keepalived.conf") do
	source "keepalived.conf.erb"
	mode "0644"
  variables(node['private_chef']['keepalived'].to_hash)
	notifies :restart, 'runit_service[keepalived]' if OmnibusHelper.should_notify?("kepalived")
end

template File.join(keepalived_bin_dir, "cluster.sh") do
	source "cluster.sh.erb"
	mode "0755"
  variables(node['private_chef']['keepalived'].to_hash)
  notifies :restart, 'runit_service[keepalived]' if OmnibusHelper.should_notify?("kepalived")
end

component_runit_service "keepalived"
{'fraction_non_alphanumeric': 0.13730196831493038, 'fraction_numerical': 0.015362457993278924, 'mean_word_length': 7.830508474576271, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6742855', 'n_tokens_mistral': 808, 'n_tokens_neox': 775, 'n_words': 143}