Newer
Older
1
2
3
4
5
6
7
8
9
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
52
53
54
55
56
57
58
59
60
61
62
63
64
# Set up apt to get the correct Debian packages.
#
# $distribution: A valid Debian distribution. This can
# be the usual ones, such as "jessie", "stretch", "buster", "sid".
# It can also be one of the stanford special ones, e.g.,
# "stretch-acs-dev", "stretch-acs-prod", etc.
#
# $repository: If the package is found in a non-standard location,
# you can indicate the repository here. Note that the repositories
# - http://debian.stanford.edu/debian-local
# - http://debian.stanford.edu/debian-stanford
# should already be convered and are considerd standard locations.
#
# #########
# Example 1
#
# class {'su_ldap::openldap_install':
# distribution => 'stretch'
# }
#
# This will install the stock OpenLDAP packages from the stretch distribution.
#
#
# #########
# Example 2:
#
# class {'su_ldap::openldap_install':
# distribution => 'stretch-acs-dev'
# }
#
# This will install the OpenLDAP packages from the special stretch-acs-dev
# distribution that resides in the "stanford" repository.
class su_ldap::apt_setup (
$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) {
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'];
}
# Update aptitude.
exec { 'ldap aptitude update':
path => '/usr/bin:/usr/sbin:/bin',
command => 'aptitude update',
refreshonly => true,
}
}
}