<commit_before>#
# Setup variables
#
server = node['cobbler']['server']
next_server = node['cobbler']['next_server']
password = node['cobbler']['password']
module_authentication = node['cobbler']['module_authentication']

#
# Install packages
#
packages = %w[ cobbler
               cobbler-web
               pykickstart
               cman ]

packages.each do |package|
  package "#{package}" do
    action :install
  end
end

#
# Enable Services
#
enable_services = %w[
              cobblerd
              httpd
              xinetd
              ]

enable_services.each do |enable_service|
  service "#{enable_service}" do
    action [:start, :enable]
  end
end

#
# Disable Services
#
service "iptables" do
  action [:stop, :disable]
end

#
# Update /etc/xinetd.d/rsync
#
cookbook_file "/etc/xinetd.d/rsync" do
  source "rsync"
  mode 0644
  owner "root"
  group "root"
  action :create
  notifies :restart, "service[xinetd]", :immediately
end

#
# Cobbler Sync
#
execute "cobbler_sync" do
  command "cobbler sync"
  action :nothing
end

#
# Cobbler Get Loaders
#
execute "cobbler_get-loaders" do
  command "cobbler get-loaders"
  action :nothing
end

#
# Update /etc/cobbler/settings
#
template "/etc/cobbler/settings" do
  source "settings.erb"
  mode 0644
  owner "root"
  group "root"
  action :create
  variables(
    :server => server,
    :next_server => next_server,
    :password => password
  )
  notifies :restart, "service[cobblerd]", :immediately
  notifies :run, "execute[cobbler_sync]", :immediately
  notifies :run, "execute[cobbler_get-loaders]", :immediately
end

#
# Update /etc/cobbler/modules.conf
#
template "/etc/cobbler/modules.conf" do
  source "modules.conf.erb"
  mode 0644
  owner "root"
  group "root"
  action :create
  variables(
    :module_authentication => module_authentication,
    :module_authorization => module_authorization
  )
  notifies :restart, "service[cobblerd]", :immediately
  notifies :restart, "service[httpd]", :immediately
end

<commit_msg>fixing cobbler recipe<commit_after>#
# Setup variables
#
server = node['cobbler']['server']
next_server = node['cobbler']['next_server']
password = node['cobbler']['password']
module_authentication = node['cobbler']['module_authentication']
module_authorization = node['cobbler']['module_authorization']

#
# Install packages
#
packages = %w[ cobbler
               cobbler-web
               pykickstart
               cman ]

packages.each do |package|
  package "#{package}" do
    action :install
  end
end

#
# Enable Services
#
enable_services = %w[
              cobblerd
              httpd
              xinetd
              ]

enable_services.each do |enable_service|
  service "#{enable_service}" do
    action [:start, :enable]
  end
end

#
# Disable Services
#
service "iptables" do
  action [:stop, :disable]
end

#
# Update /etc/xinetd.d/rsync
#
cookbook_file "/etc/xinetd.d/rsync" do
  source "rsync"
  mode 0644
  owner "root"
  group "root"
  action :create
  notifies :restart, "service[xinetd]", :immediately
end

#
# Cobbler Sync
#
execute "cobbler_sync" do
  command "cobbler sync"
  action :nothing
end

#
# Cobbler Get Loaders
#
execute "cobbler_get-loaders" do
  command "cobbler get-loaders"
  action :nothing
end

#
# Update /etc/cobbler/settings
#
template "/etc/cobbler/settings" do
  source "settings.erb"
  mode 0644
  owner "root"
  group "root"
  action :create
  variables(
    :server => server,
    :next_server => next_server,
    :password => password
  )
  notifies :restart, "service[cobblerd]", :immediately
  notifies :run, "execute[cobbler_sync]", :immediately
  notifies :run, "execute[cobbler_get-loaders]", :immediately
end

#
# Update /etc/cobbler/modules.conf
#
template "/etc/cobbler/modules.conf" do
  source "modules.conf.erb"
  mode 0644
  owner "root"
  group "root"
  action :create
  variables(
    :module_authentication => module_authentication,
    :module_authorization => module_authorization
  )
  notifies :restart, "service[cobblerd]", :immediately
  notifies :restart, "service[httpd]", :immediately
end


{'fraction_non_alphanumeric': 0.11974428325547086, 'fraction_numerical': 0.005901155642980083, 'mean_word_length': 3.5605381165919283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1064134', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1396, 'n_words': 330}