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
|
# File 'modules/wmflib/lib/puppet/parser/functions/puppet_ssldir.rb', line 22
newfunction(:puppet_ssldir, :type => :rvalue) do |overrides|
override = overrides[0]
unless ['master', 'client', nil].include?override
fail("puppet_ssldir(): only 'master', 'client' and undef are valid")
end
default = '/var/lib/puppet/ssl'
self_master = '/var/lib/puppet/server/ssl'
self_client = '/var/lib/puppet/client/ssl'
return default if lookupvar('::realm') != 'labs'
case override
when 'master'
return self_master
when 'client'
return self_client
end
return default if lookupvar('::settings::certname') =~ /\.wikimedia\.org$/
puppetmaster = lookupvar('puppetmaster')
if puppetmaster == '' || puppetmaster.nil?
default
elsif [lookupvar('hostname'), 'localhost', '', nil].include?puppetmaster
self_master
else
self_client
end
end
|