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
65
|
# File 'manifests/init.pp', line 14
class aptly (
String $package_ensure = 'installed',
Stdlib::Absolutepath $config_file = '/etc/aptly.conf',
Hash $config = {},
Optional[String] $config_contents = undef,
Boolean $repo = true,
Stdlib::Fqdn $key_server = 'keyserver.ubuntu.com',
String $user = 'root',
Hash $aptly_repos = {},
Hash $aptly_mirrors = {},
) {
if $repo {
apt::source { 'aptly':
location => 'http://repo.aptly.info/release',
repos => 'main',
key => {
name => 'aptly.asc',
source => 'https://www.aptly.info/pubkey.txt',
},
}
Apt::Source['aptly'] -> Class['apt::update'] -> Package['aptly']
}
package { 'aptly':
ensure => $package_ensure,
}
$config_file_contents = $config_contents ? {
undef => $config.stdlib::to_json_pretty,
default => $config_contents,
}
file { $config_file:
ensure => file,
content => $config_file_contents,
}
$aptly_cmd = "/usr/bin/aptly -config ${config_file}"
# Hiera support
$aptly_repos.each| String[1] $key, Hash $values| {
aptly::repo { $key:
* => $values,
}
}
$aptly_mirrors.each| String[1] $key, Hash $values| {
aptly::mirror { $key:
* => $values,
}
}
}
|