config.pp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # A description of what this class does
  2. #
  3. # @summary A short summary of the purpose of this class
  4. #
  5. # @example
  6. # include openldap::server::config
  7. class openldap::server::config {
  8. # Ensure the main server class has been defined
  9. if !defined(Class['openldap::server']) {
  10. fail 'Class openldap::server not defined'
  11. }
  12. # Generate interface lists for the three types of connections
  13. $slapd_ldap_ifs = empty($openldap::server::ldap_ifs) ? {
  14. true => '',
  15. false => join(prefix($openldap::server::ldap_ifs, 'ldap://'), ' '),
  16. }
  17. $slapd_ldapi_ifs = empty($openldap::server::ldapi_ifs) ? {
  18. true => '',
  19. false => join(prefix($openldap::server::ldapi_ifs, 'ldapi://'), ' '),
  20. }
  21. $slapd_ldaps_ifs = empty($openldap::server::ldaps_ifs) ? {
  22. true => '',
  23. false => join(prefix($openldap::server::ldaps_ifs, 'ldaps://'), ' '),
  24. }
  25. # Concat into a single interface string
  26. $slapd_ldap_urls = "${slapd_ldap_ifs} ${slapd_ldapi_ifs} ${slapd_ldaps_ifs}"
  27. case $::osfamily {
  28. 'Debian': {
  29. shellvar { 'slapd':
  30. ensure => present,
  31. target => '/etc/default/slapd',
  32. variable => 'SLAPD_SERVICES',
  33. value => $slapd_ldap_urls,
  34. }
  35. }
  36. default: {
  37. fail "Operating-system family ${::osfamily} not yet supported"
  38. }
  39. }
  40. }