-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathinit.pp
73 lines (70 loc) · 1.46 KB
/
init.pp
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
65
66
67
68
69
70
71
72
73
# == Class: cpan
#
# Installs cpan
#
# === Parameters
#
# [*manage_config*]
#
# [*manage_package*]
#
# [*installdirs*]
#
# [*local_lib*]
#
# [*config_template*]
#
# [*config_hash*]
#
# [*package_ensure*]
#
# [*ftp_proxy*]
#
# [*http_proxy*]
#
# === Examples
#
# class {'::cpan':
# manage_config => true,
# manage_package => true,
# package_ensure => 'present',
# installdirs => 'site',
# local_lib => false,
# config_hash => { 'build_requires_install_policy' => 'no' },
# ftp_proxy => 'http://your_ftp_proxy.com',
# http_proxy => 'http://your_http_proxy.com',
# }
#
class cpan (
$manage_package,
$config_hash,
$package_name,
Optional[Array[String[1]]] $config_file = undef,
Optional[Array[String[1]]] $config_dir = undef,
$package_ensure = 'present',
$manage_config = true,
$installdirs = 'site',
$local_lib = false,
$config_template = 'cpan/cpan.conf.erb',
$ftp_proxy = undef,
$http_proxy = undef,
$urllist = [],
) {
validate_bool($manage_config)
validate_bool($manage_package)
validate_string($installdirs)
validate_bool($local_lib)
validate_string($config_template)
validate_string($package_ensure)
if $ftp_proxy {
validate_string($ftp_proxy)
}
if $http_proxy {
validate_string($http_proxy)
}
validate_array($urllist)
anchor { 'cpan::begin': }
-> class { '::cpan::install': }
-> class { '::cpan::config': }
-> anchor { 'cpan::end': }
}