<commit_before># Cookbook Name:: openldap
# Attributes:: openldap
#
# Copyright 2008-2015, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

default['openldap']['basedn'] = 'dc=localdomain'
default['openldap']['cn'] = 'admin'
default['openldap']['server'] = 'ldap.localdomain'
default['openldap']['server_uri'] = "ldap://#{node['openldap']['server']}/"
default['openldap']['tls_enabled'] = true

default['openldap']['passwd_ou'] = 'people'
default['openldap']['shadow_ou'] = 'people'
default['openldap']['group_ou'] = 'groups'
default['openldap']['automount_ou'] = 'automount'

unless node['domain'].nil? || node['domain'].split('.').count < 2
  default['openldap']['basedn'] = "dc=#{node['domain'].split('.').join(',dc=')}"
  default['openldap']['server'] = "ldap.#{node['domain']}"
end

default['openldap']['loglevel'] = 0
default['openldap']['schemas'] = %w(core.schema cosine.schema nis.schema inetorgperson.schema)
default['openldap']['modules'] = %w(back_hdb)

default['openldap']['rootpw'] = nil

# File and directory locations for openldap.
case node['platform_family']
when 'rhel'
  default['openldap']['dir']        = '/etc/openldap'
  default['openldap']['run_dir']    = '/var/run/openldap'
  default['openldap']['module_dir'] = '/usr/lib64/openldap'
when 'debian'
  default['openldap']['dir']        = '/etc/ldap'
  default['openldap']['run_dir']    = '/var/run/slapd'
  default['openldap']['module_dir'] = '/usr/lib/ldap'
else
  default['openldap']['dir']        = '/etc/ldap'
  default['openldap']['run_dir']    = '/var/run/slapd'
  default['openldap']['module_dir'] = '/usr/lib/ldap'
end

default['openldap']['preseed_dir'] = '/var/cache/local/preseeding'
default['openldap']['tls_checkpeer'] = false
default['openldap']['pam_password'] = '<PASSWORD>'

default['openldap']['manage_ssl'] = true
default['openldap']['ssl_dir'] = "#{openldap['dir']}/ssl"
default['openldap']['cafile']  = nil
default['openldap']['ssl_cert'] = "#{openldap['ssl_dir']}/#{openldap['server']}_cert.pem"
default['openldap']['ssl_key'] = "#{openldap['ssl_dir']}/#{openldap['server']}.pem"
default['openldap']['ssl_cert_source_cookbook'] = 'openldap'
default['openldap']['ssl_cert_source_path'] = "ssl/#{node['openldap']['server']}_cert.pem"
default['openldap']['ssl_key_source_cookbook'] = 'openldap'
default['openldap']['ssl_key_source_path'] = "ssl/#{node['openldap']['server']}.pem"

default['openldap']['slapd_type'] = nil

if node['openldap']['slapd_type'] == 'slave'
  default['openldap']['slapd_master'] = node['openldap']['server']
  default['openldap']['slapd_replpw'] = nil
  default['openldap']['slapd_rid']    = 102
end

# package settings
default['openldap']['package_install_action'] = :install

case node['platform_family']
when 'debian'
  # precise and up and wheezy and up stopped putting the version name in the db-util package.
  # this is required to keep support for lucid
  if node['platform'] == 'ubuntu' && node['platform_version'].to_i < 12
    default['openldap']['packages']['bdb'] = 'db4.8-util'
  else
    default['openldap']['packages']['bdb'] = 'db-util'
  end
  default['openldap']['packages']['client_pkg'] = 'ldap-utils'
when 'rhel'
  default['openldap']['packages']['bdb'] = 'db-utils'
  default['openldap']['packages']['client_pkg'] = 'openldap-clients'
else
  default['openldap']['packages']['bdb'] = 'db-utils'
  default['openldap']['packages']['client_pkg'] = 'ldap-utils'
end
<commit_msg>Be more consistent with attributes in the attributes file<commit_after># Cookbook Name:: openldap
# Attributes:: openldap
#
# Copyright 2008-2015, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

default['openldap']['basedn'] = 'dc=localdomain'
default['openldap']['cn'] = 'admin'
default['openldap']['server'] = 'ldap.localdomain'
default['openldap']['server_uri'] = "ldap://#{openldap['server']}/"
default['openldap']['tls_enabled'] = true

default['openldap']['passwd_ou'] = 'people'
default['openldap']['shadow_ou'] = 'people'
default['openldap']['group_ou'] = 'groups'
default['openldap']['automount_ou'] = 'automount'

unless node['domain'].nil? || node['domain'].split('.').count < 2
  default['openldap']['basedn'] = "dc=#{node['domain'].split('.').join(',dc=')}"
  default['openldap']['server'] = "ldap.#{node['domain']}"
end

default['openldap']['loglevel'] = 0
default['openldap']['schemas'] = %w(core.schema cosine.schema nis.schema inetorgperson.schema)
default['openldap']['modules'] = %w(back_hdb)

default['openldap']['rootpw'] = nil

# File and directory locations for openldap.
case node['platform_family']
when 'rhel'
  default['openldap']['dir']        = '/etc/openldap'
  default['openldap']['run_dir']    = '/var/run/openldap'
  default['openldap']['module_dir'] = '/usr/lib64/openldap'
when 'debian'
  default['openldap']['dir']        = '/etc/ldap'
  default['openldap']['run_dir']    = '/var/run/slapd'
  default['openldap']['module_dir'] = '/usr/lib/ldap'
else
  default['openldap']['dir']        = '/etc/ldap'
  default['openldap']['run_dir']    = '/var/run/slapd'
  default['openldap']['module_dir'] = '/usr/lib/ldap'
end

default['openldap']['preseed_dir'] = '/var/cache/local/preseeding'
default['openldap']['tls_checkpeer'] = false
default['openldap']['pam_password'] = '<PASSWORD>'

default['openldap']['manage_ssl'] = true
default['openldap']['ssl_dir'] = "#{openldap['dir']}/ssl"
default['openldap']['cafile']  = nil
default['openldap']['ssl_cert'] = "#{openldap['ssl_dir']}/#{openldap['server']}_cert.pem"
default['openldap']['ssl_key'] = "#{openldap['ssl_dir']}/#{openldap['server']}.pem"
default['openldap']['ssl_cert_source_cookbook'] = 'openldap'
default['openldap']['ssl_cert_source_path'] = "ssl/#{node['openldap']['server']}_cert.pem"
default['openldap']['ssl_key_source_cookbook'] = 'openldap'
default['openldap']['ssl_key_source_path'] = "ssl/#{node['openldap']['server']}.pem"

default['openldap']['slapd_type'] = nil

if node['openldap']['slapd_type'] == 'slave'
  default['openldap']['slapd_master'] = node['openldap']['server']
  default['openldap']['slapd_replpw'] = nil
  default['openldap']['slapd_rid']    = 102
end

# package settings
default['openldap']['package_install_action'] = :install

case node['platform_family']
when 'debian'
  # precise and up and wheezy and up stopped putting the version name in the db-util package.
  # this is required to keep support for lucid
  if node['platform'] == 'ubuntu' && node['platform_version'].to_i < 12
    default['openldap']['packages']['bdb'] = 'db4.8-util'
  else
    default['openldap']['packages']['bdb'] = 'db-util'
  end
  default['openldap']['packages']['client_pkg'] = 'ldap-utils'
when 'rhel'
  default['openldap']['packages']['bdb'] = 'db-utils'
  default['openldap']['packages']['client_pkg'] = 'openldap-clients'
else
  default['openldap']['packages']['bdb'] = 'db-utils'
  default['openldap']['packages']['client_pkg'] = 'ldap-utils'
end

{'fraction_non_alphanumeric': 0.20738492665655034, 'fraction_numerical': 0.005816894284269095, 'mean_word_length': 6.6711930164888456, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6052558', 'n_tokens_mistral': 2721, 'n_tokens_neox': 2682, 'n_words': 512}