rhel-system-roles-sap/SOURCES/sap-hana-preconfigure-#98-6a417012022f38534ae5a5803062639446c9fa81.patch
2021-12-16 13:41:13 +03:00

42 lines
1.3 KiB
Diff

commit 6a417012022f38534ae5a5803062639446c9fa81
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Jul 16 19:26:58 2020 +0200
solve issue #98 (basic reboot requirement detection for RHEL 8.0)
diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml
index 0a8e1c2..502e94f 100644
--- a/tasks/RedHat/installation.yml
+++ b/tasks/RedHat/installation.yml
@@ -138,9 +138,19 @@
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '8'
+ - ansible_distribution_version != '8.0'
+
+- set_fact:
+ needs_restarting_command: "_IKRNL=$(rpm -q --last kernel | awk 'NR==1{sub(/kernel-/,\"\"); print $1}'); _CKRNL=$(uname -r); if [ ${_IKRNL} != ${_CKRNL} ]; then exit 1; else exit 0; fi"
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_distribution_version == '8.0'
+
+- debug:
+ var: needs_restarting_command
- name: Check if system needs to be restarted
- command: "{{ needs_restarting_command }}"
+ shell: "{{ needs_restarting_command }}"
register: needs_restarting_result
ignore_errors: true
changed_when: false
@@ -148,6 +158,9 @@
warn: false
check_mode: false
+- debug:
+ var: needs_restarting_result
+
- name: Call Reboot handler if necessary
command: /bin/true
notify: "Reboot handler"