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
74
75
76
77
78
79
80
81
82
83
|
# File 'manifests/config.pp', line 11
class r10k::config {
assert_private()
if $r10k::sources {
$r10k_sources = $r10k::sources
$source_keys = keys($r10k_sources)
} else {
$r10k_sources = {
'puppet' => {
'basedir' => $r10k::r10k_basedir,
'remote' => $r10k::remote,
},
}
$source_keys = keys($r10k_sources)
}
$dir_ensure = $r10k::ensure ? {
'absent' => { ensure => 'absent', recurse => true, force => true },
'present' => { ensure => 'directory', },
}
$file_ensure = $r10k::ensure ? {
'absent' => 'absent',
'present' => 'file',
}
$link_ensure = $r10k::ensure ? {
'absent' => 'absent',
'present' => 'link',
}
if $r10k::configfile == '/etc/puppetlabs/r10k/r10k.yaml' {
file { '/etc/puppetlabs/r10k':
owner => $r10k::root_user,
group => $r10k::root_group,
mode => '0755',
* => $dir_ensure,
}
}
$config = {
'pool_size' => $r10k::pool_size,
'proxy' => $r10k::proxy,
'forge' => $r10k::forge_settings,
'git' => $r10k::git_settings,
'deploy' => $r10k::deploy_settings,
'cachedir' => $r10k::cachedir,
'postrun' => $r10k::postrun,
'sources' => $r10k_sources,
}.delete_undef_values
file { 'r10k.yaml':
ensure => $file_ensure,
owner => $r10k::root_user,
group => $r10k::root_group,
mode => '0644',
path => $r10k::configfile,
content => stdlib::to_yaml($config),
}
if $r10k::manage_configfile_symlink {
file { 'symlink_r10k.yaml':
ensure => $link_ensure,
path => $r10k::configfile_symlink,
target => $r10k::configfile,
}
}
if $r10k::manage_modulepath {
ini_setting { 'R10k Modulepath':
ensure => $r10k::ensure,
path => "${r10k::puppetconf_path}/puppet.conf",
section => 'main',
setting => 'modulepath',
value => $r10k::modulepath,
}
}
}
|