|
12 | 12 | confdir = '/usr/local/etc/puppet' |
13 | 13 | environments_dir = '/usr/local/etc/puppet/environments' |
14 | 14 | etcdir = '/usr/local/etc/puppet' |
15 | | - if facts[:puppetversion] >= '6.0' |
16 | | - puppetcacmd = '/usr/local/bin/puppetserver ca setup' |
17 | | - else |
18 | | - puppetcacmd = '/usr/local/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names' |
19 | | - end |
20 | 15 | puppetserver_logdir = '/var/log/puppetserver' |
21 | 16 | puppetserver_rundir = '/var/run/puppetserver' |
22 | 17 | puppetserver_vardir = '/var/puppet/server/data/puppetserver' |
|
25 | 20 | vardir = '/var/puppet' |
26 | 21 | rubydir = %r{^/usr/local/lib/ruby/site_ruby/\d+\.\d+/puppet$} |
27 | 22 | puppetserver_pkg = puppet_major > 4 ? "puppetserver#{puppet_major}" : 'puppetserver' |
| 23 | + if facts[:puppetversion] >= '6.0' |
| 24 | + puppetcacmd = '/usr/local/bin/puppetserver ca setup' |
| 25 | + cert_to_create = "#{ssldir}/ca/ca_crt.pem" |
| 26 | + else |
| 27 | + puppetcacmd = '/usr/local/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names' |
| 28 | + cert_to_create = "#{ssldir}/certs/puppetmaster.example.com.pem" |
| 29 | + end |
28 | 30 | else |
29 | 31 | codedir = '/etc/puppetlabs/code' |
30 | 32 | conf_d_dir = '/etc/puppetlabs/puppetserver/conf.d' |
31 | 33 | conf_file = '/etc/puppetlabs/puppet/puppet.conf' |
32 | 34 | confdir = '/etc/puppetlabs/puppet' |
33 | 35 | environments_dir = '/etc/puppetlabs/code/environments' |
34 | 36 | etcdir = '/etc/puppetlabs/puppet' |
35 | | - if facts[:puppetversion] >= '6.0' |
36 | | - puppetcacmd = '/opt/puppetlabs/bin/puppetserver ca setup' |
37 | | - else |
38 | | - puppetcacmd = '/opt/puppetlabs/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names' |
39 | | - end |
40 | 37 | puppetserver_logdir = '/var/log/puppetlabs/puppetserver' |
41 | 38 | puppetserver_rundir = '/var/run/puppetlabs/puppetserver' |
42 | 39 | puppetserver_vardir = '/opt/puppetlabs/server/data/puppetserver' |
|
45 | 42 | vardir = '/opt/puppetlabs/puppet/cache' |
46 | 43 | rubydir = '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet' |
47 | 44 | puppetserver_pkg = 'puppetserver' |
| 45 | + if facts[:puppetversion] >= '6.0' |
| 46 | + puppetcacmd = '/opt/puppetlabs/bin/puppetserver ca setup' |
| 47 | + cert_to_create = "#{ssldir}/ca/ca_crt.pem" |
| 48 | + else |
| 49 | + puppetcacmd = '/opt/puppetlabs/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names' |
| 50 | + cert_to_create = "#{ssldir}/certs/puppetmaster.example.com.pem" |
| 51 | + end |
48 | 52 | end |
49 | 53 |
|
50 | 54 | let(:facts) { facts } |
|
109 | 113 | .with_umask('0022') |
110 | 114 |
|
111 | 115 | should contain_exec('puppet_server_config-generate_ca_cert') \ |
112 | | - .with_creates("#{ssldir}/certs/puppetmaster.example.com.pem") \ |
| 116 | + .with_creates(cert_to_create) \ |
113 | 117 | .with_command(puppetcacmd) \ |
114 | 118 | .with_umask('0022') \ |
115 | 119 | .that_requires(["Concat[#{conf_file}]", 'Exec[puppet_server_config-create_ssl_dir]']) |
|
0 commit comments