|
110 | 110 | default => '--jre' |
111 | 111 | } |
112 | 112 |
|
113 | | - # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package |
114 | | - # Only attempt this if SUSEConnect is available and the system is registered |
115 | | - # Enable Legacy (already in your code) |
116 | | - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { |
117 | | - exec { 'Enable legacy repos': |
| 113 | + # TEMPORARY FIX: If no repos are configured on SLES, add openSUSE Leap as fallback |
| 114 | + # This workaround is needed because GCP-provisioned SLES images are unregistered BYOS |
| 115 | + # without any package repositories configured. Remove this once proper PAYG images are used. |
| 116 | + if ($facts['os']['family'] in ['SLES', 'SUSE']) { |
| 117 | + exec { 'Add openSUSE repo if no repos exist': |
118 | 118 | path => '/bin:/usr/bin:/sbin:/usr/sbin', |
119 | | - command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['major']}/x86_64", |
120 | | - unless => "test ! -x /usr/bin/SUSEConnect || SUSEConnect --status-text | grep -qE '(Not Registered|sle-module-legacy/${facts['os']['release']['major']}/x86_64)'", |
| 119 | + command => 'zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/distribution/leap/15.6/repo/oss/ opensuse-leap-fallback', |
| 120 | + unless => "zypper lr | grep -q '|'", |
121 | 121 | logoutput => true, |
122 | 122 | } |
123 | | - |
124 | | - # NEW: enable Development Tools (for many *-devel packages, including OpenJDK 8) |
125 | | - exec { 'Enable development tools': |
126 | | - path => '/bin:/usr/bin:/sbin:/usr/sbin', |
127 | | - command => "SUSEConnect --product sle-module-development-tools/${facts['os']['release']['major']}/x86_64", |
128 | | - unless => "test ! -x /usr/bin/SUSEConnect || SUSEConnect --status-text | grep -qE '(Not Registered|sle-module-development-tools/${facts['os']['release']['major']}/x86_64)'", |
129 | | - logoutput => true, |
130 | | - require => Exec['Enable legacy repos'], |
131 | | - } |
132 | 123 | } |
133 | 124 |
|
134 | 125 | if $facts['os']['family'] == 'Debian' { |
|
0 commit comments