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
|
# File 'manifests/jenkins/jcasc.pp', line 8
class psick::jenkins::jcasc (
Variant[Boolean,String] $ensure = 'present',
Array $plugins = [ 'configuration-as-code','configuration-as-code-support' ],
Optional[String] $config_template = undef,
Optional[String] $config_path = undef,
Hash $options_hash = {},
String $jenkins_reload_command = 'service jenkins force-reload',
) {
$plugin_enable = $ensure ? {
'absent' => false,
default => true,
}
$plugins.each | $plugin | {
if !defined(Psick::Jenkins::Plugin[$plugin]) {
psick::jenkins::plugin { $plugin:
enable => $plugin_enable,
}
}
}
$real_config_path = pick($config_path,"${::psick::jenkins::home_dir}/jenkins.yaml")
$options = $options_hash
if $config_template {
file { $real_config_path :
ensure => $ensure,
mode => '0644',
owner => 'jenkins',
group => 'jenkins',
notify => Service['jenkins'],
replace => false,
content => template($config_template),
require => Package['jenkins'],
}
}
}
|