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
|
# File 'manifests/repo/apt.pp', line 23
class mongodb::repo::apt (
Enum['present', 'absent'] $ensure,
String[1] $repo_location,
String[1] $keyring_location,
Optional[String[1]] $release = undef,
Optional[String[1]] $repos = undef,
Optional[String[1]] $comment = undef,
) {
# we try to follow/reproduce the instruction
# from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
assert_private()
include apt
$keyring_file = split($keyring_location, '/')[-1]
apt::source { 'mongodb':
ensure => $ensure,
location => $repo_location,
release => $mongodb::repo::release,
repos => $mongodb::repo::repos,
key => {
dir => '/usr/share/keyrings/',
name => "mongodb-${keyring_file}",
source => $keyring_location,
},
comment => $comment,
}
if($ensure == 'present') {
Apt::Source['mongodb'] -> Class['apt::update'] -> Package<| tag == 'mongodb_package' |>
}
}
|