<commit_before>include_recipe "bach_krb5::default"
include_recipe "krb5::kadmin"
include_recipe "krb5::kadmin_service"

template "/etc/krb5kdc/kdc.conf" do
  owner 'root'
  group 'root'
  mode '0644'
  source "kdc.conf.erb"
  cookbook "krb5"
  variables node['krb5']['kdc_conf']
end

include_recipe "krb5::kadmin_init"

kdc_resource = resources("service[krb5-kdc]")
kdc_resource.supports(:status => true, :restart => true, :reload => false)
kdc_resource.action([:enable, :start])
kdc_resource.subscribes(:restart, "template #{node['krb5']['data_dir']}/kdc.conf", :delayed) 

kadm_resource = resources("service[krb5-admin-server]")
kadm_resource.supports(:status => true, :restart => true, :reload => false)
kadm_resource.action([:enable, :start])
kadm_resource.subscribes(:restart, "template node['krb5']['kdc_conf']['realms'][default_realm]['acl_file']", :delayed)

include_recipe "bach_krb5::gems"<commit_msg>Start Kerberos services after installation/configuration<commit_after>include_recipe "bach_krb5::default"
include_recipe "krb5::kadmin"
include_recipe "krb5::kadmin_service"

template "/etc/krb5kdc/kdc.conf" do
  owner 'root'
  group 'root'
  mode '0644'
  source "kdc.conf.erb"
  cookbook "krb5"
  variables node['krb5']['kdc_conf']
end

include_recipe "krb5::kadmin_init"

ruby_block 'start_kerberos_services' do
  block do
    kdc_resource = run_context.resource_collection.find("service[krb5-kdc]")
    kdc_resource.supports(:status => true, :restart => true, :reload => false)
    kdc_resource.action([:enable, :start])
    kdc_resource.subscribes(:restart, "template #{node['krb5']['data_dir']}/kdc.conf", :delayed)
    kdc_resource.run_action(:start)

    kadm_resource = run_context.resource_collection.find("service[krb5-admin-server]")
    kadm_resource.supports(:status => true, :restart => true, :reload => false)
    kadm_resource.action([:enable, :start])
    kadm_resource.subscribes(:restart, "template node['krb5']['kdc_conf']['realms'][default_realm]['acl_file']", :delayed)
    kadm_resource.run_action(:start)
  end
end

include_recipe "bach_krb5::gems"
{'fraction_non_alphanumeric': 0.15978886756238003, 'fraction_numerical': 0.015355086372360844, 'mean_word_length': 7.14453125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4927653', 'n_tokens_mistral': 795, 'n_tokens_neox': 778, 'n_words': 120}