Puppet Class: profile::ldap::bitu

Defined in:
modules/profile/manifests/ldap/bitu.pp

Summary

Install and configure python3-bitu-ldap. This library is designed to make interaction with LDAP from Python script easier. This profile provides a default configuration which ensure that a users can automatically connect and manage LDAP users and groups.

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • ldap (Hash) (defaults to: lookup('ldap'))

    Hash containing LDAP connection info.

  • group (String[0]) (defaults to: lookup('profile::ldap::bitu::group'))

    The group to use for sensitive files



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'modules/profile/manifests/ldap/bitu.pp', line 10

class profile::ldap::bitu (
    Hash      $ldap = lookup('ldap'),
    String[0] $group = lookup('profile::ldap::bitu::group'),
) {
    if debian::codename::eq('buster') {
        apt::package_from_component { 'python3-ldap3':
        component => 'component/python3-ldap3',
        }
    }

    ensure_packages([
        'python3-bitu-ldap',
    ])

    $bitu_config = {
        uri      => ["ldaps://${ldap['rw-server']}:636"],
        username => $ldap['script_user_dn'],
        password => $ldap['script_user_pass'],
        groups   => {
            dn                => "${ldap['groups_cn']},${ldap['base-dn']}",
            auxiliary_classes => ['posixGroup'],
        },
        users    => {
            dn                => "${ldap['users_cn']},${ldap['base-dn']}",
            auxiliary_classes => ['posixAccount', 'wikimediaPerson'],
        },
    }

    file { '/etc/bitu/':
        ensure => directory,
        owner  => 'root',
        group  => $group,
        mode   => '0770',
    }

    file { '/etc/bitu/ldap.json':
        owner   => 'root',
        group   => $group,
        mode    => '0550',
        content => $bitu_config.to_json_pretty,
    }
}