Skip to content
Snippets Groups Projects
openldap_install.pp 918 B
Newer Older
# Basic configuration: /etc/ldap/ldap.conf, /etc/default/slapd, et al.

class su_ldap::openldap_install (
  $distribution = undef,
  $repository   = undef,
)
{

  # Only need to do something if $distribution is defined.

  if ($distribution) {
    # If $repository is defined, we need to add a file in
    # /etc/apt/sources.list.d.
    if ($repository) {
Adam Lewenberg's avatar
Adam Lewenberg committed
      file { '/etc/apt/sources.list.d/ldap.list':
        content => template('su_ldap/etc/apt/sources.list.d/ldap.erb')
      }
    }

    # Pin some OpenLDAP packages.
    file { '/etc/apt/preferences.d/ldap':
      content => template('su_ldap/etc/apt/preferences.d/ldap.erb'),
      notify  => Exec['ldap aptitude update'];
    }

    # What about special sasl? LATER.

    # Update aptitude.
    exec { 'ldap aptitude update':
Adam Lewenberg's avatar
Adam Lewenberg committed
      path        => '/usr/bin:/usr/sbin:/bin',
      command     => 'aptitude update',
      refreshonly => true,
    }

  }