|
8 | 8 | let(:facts) do |
9 | 9 | facts |
10 | 10 | end |
11 | | - |
| 11 | + let(:java_bin) { %r{^set JAVA_BIN /usr/(lib/jvm/jre-1[17]/)?bin/java$} } |
12 | 12 | let(:auth_conf) { '/etc/custom/puppetserver/conf.d/auth.conf' } |
13 | 13 | let(:puppetserver_conf) { '/etc/custom/puppetserver/conf.d/puppetserver.conf' } |
14 | 14 |
|
|
58 | 58 | if facts[:os]['family'] == 'RedHat' and facts[:os]['release']['major'] != '7' |
59 | 59 | it { |
60 | 60 | should contain_augeas('puppet::server::puppetserver::jvm') |
61 | | - .with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false"\'', 'set JAVA_BIN /usr/bin/java']) |
| 61 | + .with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false"\'', java_bin]) |
62 | 62 | .with_context('/files/etc/default/puppetserver') |
63 | 63 | .with_incl('/etc/default/puppetserver') |
64 | 64 | .with_lens('Shellvars.lns') |
65 | 65 | } |
66 | 66 | else |
67 | 67 | it { |
68 | 68 | should contain_augeas('puppet::server::puppetserver::jvm') |
69 | | - .with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G"\'', 'set JAVA_BIN /usr/bin/java']) |
| 69 | + .with_changes(['set JAVA_ARGS \'"-Xms2G -Xmx2G"\'', java_bin]) |
70 | 70 | .with_context('/files/etc/default/puppetserver') |
71 | 71 | .with_incl('/etc/default/puppetserver') |
72 | 72 | .with_lens('Shellvars.lns') |
|
390 | 390 | should contain_augeas('puppet::server::puppetserver::jvm') |
391 | 391 | .with_changes([ |
392 | 392 | 'set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false -XX:foo=bar -XX:bar=foo"\'', |
393 | | - 'set JAVA_BIN /usr/bin/java' |
| 393 | + java_bin |
394 | 394 | ]) |
395 | 395 | .with_context('/files/etc/default/puppetserver') |
396 | 396 | .with_incl('/etc/default/puppetserver') |
|
401 | 401 | should contain_augeas('puppet::server::puppetserver::jvm') |
402 | 402 | .with_changes([ |
403 | 403 | 'set JAVA_ARGS \'"-Xms2G -Xmx2G -XX:foo=bar -XX:bar=foo"\'', |
404 | | - 'set JAVA_BIN /usr/bin/java' |
| 404 | + java_bin |
405 | 405 | ]) |
406 | 406 | .with_context('/files/etc/default/puppetserver') |
407 | 407 | .with_incl('/etc/default/puppetserver') |
|
417 | 417 | should contain_augeas('puppet::server::puppetserver::jvm') |
418 | 418 | .with_changes([ |
419 | 419 | 'set JAVA_ARGS \'"-Xms2G -Xmx2G -Dcom.redhat.fips=false"\'', |
420 | | - 'set JAVA_BIN /usr/bin/java', |
| 420 | + java_bin, |
421 | 421 | 'set JAVA_ARGS_CLI \'"-Djava.io.tmpdir=/var/puppettmp"\'' |
422 | 422 | ]) |
423 | 423 | .with_context('/files/etc/default/puppetserver') |
|
429 | 429 | should contain_augeas('puppet::server::puppetserver::jvm') |
430 | 430 | .with_changes([ |
431 | 431 | 'set JAVA_ARGS \'"-Xms2G -Xmx2G"\'', |
432 | | - 'set JAVA_BIN /usr/bin/java', |
| 432 | + java_bin, |
433 | 433 | 'set JAVA_ARGS_CLI \'"-Djava.io.tmpdir=/var/puppettmp"\'' |
434 | 434 | ]) |
435 | 435 | .with_context('/files/etc/default/puppetserver') |
|
0 commit comments