Skip to content

sap_*_preconfigure: Define needs-restarting also for RHEL 10 #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions roles/sap_general_preconfigure/tasks/RedHat/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,11 @@
__sap_general_preconfigure_fact_needs_restarting_command: "needs-restarting -r"
when: ansible_distribution_major_version == '7'

- name: "Set needs-restarting command in case of RHEL 8 or RHEL 9, except RHEL 8.0"
- name: "Set needs-restarting command in case of RHEL 8 or greater, except RHEL 8.0"
ansible.builtin.set_fact:
__sap_general_preconfigure_fact_needs_restarting_command: "yum needs-restarting -r"
when:
- (ansible_distribution_major_version == '8' or
ansible_distribution_major_version == '9'
)
- ansible_distribution_major_version | int >= 8
- ansible_distribution_version != '8.0'

- name: "Set customized needs-restarting command in case of RHEL 8.0"
Expand Down
11 changes: 3 additions & 8 deletions roles/sap_hana_preconfigure/tasks/RedHat/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,32 +202,27 @@
ansible.builtin.set_fact:
__sap_hana_preconfigure_fact_needs_restarting_command: "needs-restarting -r"
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == '7'

- name: "Set needs-restarting command in case of RHEL 8 or RHEL 9, except RHEL 8.0"
- name: "Set needs-restarting command in case of RHEL 8 or greater, except RHEL 8.0"
ansible.builtin.set_fact:
__sap_hana_preconfigure_fact_needs_restarting_command: "yum needs-restarting -r"
when:
- ansible_os_family == 'RedHat'
- (ansible_distribution_major_version == '8' or
ansible_distribution_major_version == '9'
)
- ansible_distribution_major_version | int >= 8
- ansible_distribution_version != '8.0'

- name: "Set customized needs-restarting command in case of RHEL 8.0"
ansible.builtin.set_fact:
__sap_hana_preconfigure_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'

- name: Display the command for checking a reboot requirement
ansible.builtin.debug:
var: __sap_hana_preconfigure_fact_needs_restarting_command

# Reason for noqa: The command to be executed might contain pipes
- name: Determine if system needs to be restarted # noqa command-instead-of-shell
- name: Determine if the system needs to be restarted # noqa command-instead-of-shell
ansible.builtin.shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command }}"
register: __sap_hana_preconfigure_register_needs_restarting
ignore_errors: true
Expand Down