diff --git a/manifests/init.pp b/manifests/init.pp index 7e40c6f5..c2295fb6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,6 +110,16 @@ default => '--jre' } + # Enable legacy repo to install net-tools-deprecated package + # If SUSE OS major version is >= 15 and minor version is > 3 + if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['major'], '15') >= 0 and versioncmp($facts['os']['release']['minor'], '3') == 1) { + exec { 'Enable legacy repos': + path => '/bin:/usr/bin/:/sbin:/usr/sbin', + command => 'SUSEConnect --product sle-module-legacy/15.4/x86_64', + unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.4/x86_64', + } + } + if $facts['os']['family'] == 'Debian' { # Needed for update-java-alternatives package { 'java-common': diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index de2f3966..61f357fb 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -144,14 +144,14 @@ end context 'when selecting default for SLES 11.3' do - let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3', major: '11', minor: '3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_6_0-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.6.0-ibm-1.6.0/') } end context 'when selecting default for SLES 11.4' do - let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4', major: '11', minor: '4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_1-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.1-ibm-1.7.1/') }