@@ -184,23 +184,6 @@ phases:
184
184
fi
185
185
fi
186
186
187
- - name : CreatingJsonFile
188
- action : CreateFile
189
- inputs :
190
- - path : /etc/parallelcluster/image_dna.json
191
- content : |
192
- ${CfnParamChefDnaJson}
193
- overwrite : true
194
-
195
- - name : DisableKernelUpdate
196
- action : ExecuteBash
197
- inputs :
198
- commands :
199
- - |
200
- set -v
201
- DISABLE_KERNEL_UPDATE=$(cat /etc/parallelcluster/image_dna.json | jq -r '.cluster.disable_kernel_update.enabled')
202
- echo "${!DISABLE_KERNEL_UPDATE}"
203
-
204
187
- name : PinKernelVersion
205
188
action : ExecuteBash
206
189
inputs :
@@ -209,27 +192,24 @@ phases:
209
192
set -v
210
193
OS='{{ build.OperatingSystemName.outputs.stdout }}'
211
194
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
212
- DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}'
213
-
214
- if [[ ${!DISABLE_KERNEL_UPDATE} == true ]]; then
215
- if [[ ${!PLATFORM} == RHEL ]]; then
216
- yum install -y yum-plugin-versionlock
217
- # listing all the packages because wildcard does not work as expected
218
- yum versionlock kernel kernel-core kernel-modules
219
-
220
- if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
221
- yum versionlock kernel-abi-whitelists
222
- else
223
- yum versionlock kernel-abi-stablelists
224
- fi
225
195
226
- if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
227
- yum versionlock rocky-release rocky-repos
228
- elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then
229
- yum versionlock redhat-release
230
- fi
231
- echo "Kernel version locked"
196
+ if [[ ${!PLATFORM} == RHEL ]]; then
197
+ yum install -y yum-plugin-versionlock
198
+ # listing all the packages because wildcard does not work as expected
199
+ yum versionlock kernel kernel-core kernel-modules
200
+
201
+ if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
202
+ yum versionlock kernel-abi-whitelists
203
+ else
204
+ yum versionlock kernel-abi-stablelists
205
+ fi
206
+
207
+ if [[ ${!OS} == "rocky8" ]] || [[ ${!OS} == "rocky9" ]] ; then
208
+ yum versionlock rocky-release rocky-repos
209
+ elif [[ ${!OS} == "rhel8" ]] || [[ ${!OS} == "rhel9" ]] ; then
210
+ yum versionlock redhat-release
232
211
fi
212
+ echo "Kernel version locked"
233
213
fi
234
214
235
215
# Install prerequisite OS packages
@@ -326,6 +306,14 @@ phases:
326
306
cookbook_path ['/etc/chef/cookbooks']
327
307
overwrite : true
328
308
309
+ - name : CreatingJsonFile
310
+ action : CreateFile
311
+ inputs :
312
+ - path : /etc/parallelcluster/image_dna.json
313
+ content : |
314
+ ${CfnParamChefDnaJson}
315
+ overwrite : true
316
+
329
317
- name : InstallPClusterPackages
330
318
action : ExecuteBash
331
319
inputs :
@@ -352,10 +340,9 @@ phases:
352
340
set -v
353
341
OS='{{ build.OperatingSystemName.outputs.stdout }}'
354
342
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
355
- DISABLE_KERNEL_UPDATE='{{ build.DisableKernelUpdate.outputs.stdout }}'
356
343
357
344
# Remove kernel version lock
358
- if [[ ${!DISABLE_KERNEL_UPDATE} == true ]] && [[ ${! PLATFORM} == RHEL ]]; then
345
+ if [[ ${!PLATFORM} == RHEL ]]; then
359
346
yum versionlock delete kernel kernel-core kernel-modules
360
347
361
348
if [[ ${!OS} == "alinux2" ]] || [[ ${!OS} == "alinux2023" ]] ; then
0 commit comments