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

upgrades_dir = node['private_chef']['upgrades']['dir']
upgrades_etc_dir = File.join(upgrades_dir, "etc")
upgrades_service_dir = "/opt/opscode/embedded/service/partybus"
[
  upgrades_dir,
  upgrades_etc_dir,
  upgrades_service_dir
].each do |dir_name|
  directory dir_name do
    owner node['private_chef']['user']['username']
    mode '0700'
    recursive true
  end
end

partybus_config = File.join(upgrades_etc_dir, "config.rb")

# set the db connection string
db_protocol = "postgres"
db_user     = node['private_chef']['postgresql']['sql_user']
db_password = node['private_chef']['postgresql']['sql_password']
db_vip      = node['private_chef']['postgresql']['vip']
db_name     = "opscode_chef"

db_connection_string = "#{db_protocol}://#{db_user}:#{db_password}@#{db_vip}/#{db_name}"

db_service_name = "postgres"

# set the node role
node_role = node['private_chef']['role']

template partybus_config do
  source "partybus_config.rb.erb"
  owner node['private_chef']['user']['username']
  mode   "0644"
  variables(:connection_string => db_connection_string,
            :node_role => node_role,
            :db_service_name => db_service_name,
            :is_data_master => OmnibusHelper.is_data_master?(node),
            :bootstrap_server => node['private_chef']['bootstrap']['enable'])
end

link "/opt/opscode/embedded/service/partybus/config.rb" do
  to partybus_config
end

execute "set initial migration level" do
  action :nothing
  command "cd /opt/opscode/embedded/service/partybus && ./bin/partybus init"
  subscribes :run, resources(:directory => "/var/opt/opscode"), :delayed
end
<commit_msg>Use is_bootstrap_server? in Partybus config<commit_after>#
# Author:: <NAME> (<<EMAIL>>)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
#
# All Rights Reserved

upgrades_dir = node['private_chef']['upgrades']['dir']
upgrades_etc_dir = File.join(upgrades_dir, "etc")
upgrades_service_dir = "/opt/opscode/embedded/service/partybus"
[
  upgrades_dir,
  upgrades_etc_dir,
  upgrades_service_dir
].each do |dir_name|
  directory dir_name do
    owner node['private_chef']['user']['username']
    mode '0700'
    recursive true
  end
end

partybus_config = File.join(upgrades_etc_dir, "config.rb")

# set the db connection string
db_protocol = "postgres"
db_user     = node['private_chef']['postgresql']['sql_user']
db_password = node['private_chef']['postgresql']['sql_password']
db_vip      = node['private_chef']['postgresql']['vip']
db_name     = "opscode_chef"

db_connection_string = "#{db_protocol}://#{db_user}:#{db_password}@#{db_vip}/#{db_name}"

db_service_name = "postgres"

# set the node role
node_role = node['private_chef']['role']

template partybus_config do
  source "partybus_config.rb.erb"
  owner node['private_chef']['user']['username']
  mode   "0644"
  variables(:connection_string => db_connection_string,
            :node_role => node_role,
            :db_service_name => db_service_name,
            :is_data_master => OmnibusHelper.is_data_master?(node),
            :bootstrap_server => OmnibusHelper.is_bootstrap_server?(node))
end

link "/opt/opscode/embedded/service/partybus/config.rb" do
  to partybus_config
end

execute "set initial migration level" do
  action :nothing
  command "cd /opt/opscode/embedded/service/partybus && ./bin/partybus init"
  subscribes :run, resources(:directory => "/var/opt/opscode"), :delayed
end

{'fraction_non_alphanumeric': 0.14531384350816853, 'fraction_numerical': 0.006878761822871883, 'mean_word_length': 5.166077738515901, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '2495038', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1201, 'n_words': 224}