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
|
# File 'manifests/init.pp', line 14
class aptly (
String $package_ensure = 'present',
Stdlib::Absolutepath $config_file = '/etc/aptly.conf',
Hash $config = {},
Optional[String] $config_contents = undef,
Boolean $repo = true,
String $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 => 'squeeze',
repos => 'main',
key => {
server => $key_server,
id => '78D6517AB92E22947F577996A0546A43624A8331',
},
}
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
create_resources('::aptly::repo', $aptly_repos)
create_resources('::aptly::mirror', $aptly_mirrors)
}
|