Skip to content
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

sap_*_preconfigure: Add code for RHEL 10 support #938

Merged
merged 6 commits into from
Jan 23, 2025
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
72 changes: 72 additions & 0 deletions roles/sap_general_preconfigure/tasks/sapnote/3562909.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure - Display SAP note number 3562909 and its version
ansible.builtin.debug:
msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3562909$') | first).number }}
(version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3562909$') | first).version }}): Configure RHEL 9"
tags:
- always

- name: Import tasks from '3562909/02-configure-selinux.yml'
ansible.builtin.import_tasks: 3562909/02-configure-selinux.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_02 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_02

- name: Import tasks from '3562909/03-configure-hostname.yml'
ansible.builtin.import_tasks: 3562909/03-configure-hostname.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_03 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_03

- name: Import tasks from '3562909/04-configure-network-time-and-date.yml'
ansible.builtin.import_tasks: 3562909/04-configure-network-time-and-date.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_04 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_04

- name: Import tasks from '3562909/05-configure-firewall.yml'
ansible.builtin.import_tasks: 3562909/05-configure-firewall.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_05 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_05

- name: Import tasks from '3562909/06-configure-uuidd.yml'
ansible.builtin.import_tasks: 3562909/06-configure-uuidd.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_06 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_06

- name: Import tasks from '3562909/07-configure-tmpfs.yml'
ansible.builtin.import_tasks: 3562909/07-configure-tmpfs.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_07 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_07

- name: Import tasks from '3562909/08-configure-linux-kernel-parameters.yml'
ansible.builtin.import_tasks: 3562909/08-configure-linux-kernel-parameters.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_08 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_08

- name: Import tasks from '3562909/09-configure-process-resource-limits.yml'
ansible.builtin.import_tasks: 3562909/09-configure-process-resource-limits.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_09 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_09

- name: Import tasks from '3562909/10-configure-systemd-tmpfiles.yml'
ansible.builtin.import_tasks: 3562909/10-configure-systemd-tmpfiles.yml
when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_3562909_10 | d(false)
tags:
- sap_general_preconfigure_3562909
- sap_general_preconfigure_3562909_10
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-2
ansible.builtin.debug:
msg: "SAP note 3562909 Step 2: Configure SELinux"
tags:
- sap_general_preconfigure_selinux

- name: Import tasks from '../../RedHat/generic/assert-selinux.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-selinux.yml
tags:
- sap_general_preconfigure_selinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-2
ansible.builtin.debug:
msg: "SAP note 3562909 Step 2: Configure SELinux"
tags:
- sap_general_preconfigure_selinux

- name: Import tasks from '../../RedHat/generic/configure-selinux.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-selinux.yml
tags:
- sap_general_preconfigure_selinux
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-3
ansible.builtin.debug:
msg: "SAP note 3562909 Step 3: Configure Hostname"
tags:
- sap_general_preconfigure_hostname
- sap_general_preconfigure_etc_hosts
- sap_general_preconfigure_dns_name_resolution

- name: Import tasks from '../../RedHat/generic/assert-hostname.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-hostname.yml
tags:
- sap_general_preconfigure_hostname

- name: Import tasks from '../../RedHat/generic/assert-etc-hosts.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-etc-hosts.yml
tags:
- sap_general_preconfigure_etc_hosts

- name: Import tasks from '../../RedHat/generic/assert-dns-name-resolution.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-dns-name-resolution.yml
tags:
- sap_general_preconfigure_dns_name_resolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-3
ansible.builtin.debug:
msg: "SAP note 3562909 Step 3: Configure Hostname"
tags:
- sap_general_preconfigure_hostname
- sap_general_preconfigure_etc_hosts
- sap_general_preconfigure_dns_name_resolution

- name: Import tasks from '../../RedHat/generic/configure-hostname.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-hostname.yml
tags:
- sap_general_preconfigure_hostname

- name: Import role sap_maintain_etc_hosts
ansible.builtin.import_role:
name: '{{ sap_general_preconfigure_sap_install_collection }}.sap_maintain_etc_hosts'
vars:
sap_maintain_etc_hosts_list:
- node_ip: "{{ sap_general_preconfigure_ip }}"
node_name: "{{ sap_general_preconfigure_hostname }}"
node_domain: "{{ sap_general_preconfigure_domain }}"
state: present
when: sap_general_preconfigure_modify_etc_hosts
tags:
- sap_general_preconfigure_etc_hosts

- name: Import tasks from '../../RedHat/generic/assert-etc-hosts.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-etc-hosts.yml
when: not sap_general_preconfigure_modify_etc_hosts
tags:
- sap_general_preconfigure_etc_hosts

- name: Import tasks from '../../RedHat/generic/check-dns-name-resolution.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/check-dns-name-resolution.yml
tags:
- sap_general_preconfigure_dns_name_resolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-4
ansible.builtin.debug:
msg: "SAP note 3562909 Step 4: Configure Network Time and Date"
tags:
- sap_general_preconfigure_network_time_and_date

# Reason for noqa: We need to get the current status only
- name: Get status of chronyd # noqa command-instead-of-module
ansible.builtin.command: systemctl status chronyd
register: __sap_general_preconfigure_register_chronyd_status_assert
ignore_errors: true
changed_when: false
tags:
- sap_general_preconfigure_network_time_and_date

- name: Assert that chronyd is enabled
ansible.builtin.assert:
that: "'/usr/lib/systemd/system/chronyd.service; enabled' in __sap_general_preconfigure_register_chronyd_status_assert.stdout"
fail_msg: "FAIL: Service 'chronyd' is not enabled!"
success_msg: "PASS: Service 'chronyd' is enabled."
ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}"
tags:
- sap_general_preconfigure_network_time_and_date

- name: Assert that chronyd is active
ansible.builtin.assert:
that: "'active (running)' in __sap_general_preconfigure_register_chronyd_status_assert.stdout"
fail_msg: "FAIL: Service 'chronyd' is not active!"
success_msg: "PASS: Service 'chronyd' is active."
ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}"
tags:
- sap_general_preconfigure_network_time_and_date
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-4
ansible.builtin.debug:
msg: "SAP note 3562909 Step 4: Configure Network Time and Date"
tags:
- sap_general_preconfigure_network_time_and_date

- name: Start and enable service chronyd
ansible.builtin.systemd:
name: chronyd
state: started
enabled: true
tags:
- sap_general_preconfigure_network_time_and_date
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-5
ansible.builtin.debug:
msg: "SAP note 3562909 Step 5: Configure the Firewall"
tags:
- sap_general_preconfigure_firewall

- name: Import tasks from '../../RedHat/generic/assert-firewall.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-firewall.yml
tags:
- sap_general_preconfigure_firewall
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-5
ansible.builtin.debug:
msg: "SAP note 3562909 Step 5: Configure the Firewall"
tags:
- sap_general_preconfigure_firewall

- name: Import tasks from '../../RedHat/generic/configure-firewall.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-firewall.yml
tags:
- sap_general_preconfigure_firewall
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-6
ansible.builtin.debug:
msg: "SAP note 3562909 Step 6: Configure uuidd"
tags:
- sap_general_preconfigure_configure_uuidd

- name: Import tasks from '../../RedHat/generic/assert-uuidd.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-uuidd.yml
tags:
- sap_general_preconfigure_configure_uuidd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-6
ansible.builtin.debug:
msg: "SAP note 3562909 Step 6: Configure uuidd"
tags:
- sap_general_preconfigure_configure_uuidd

- name: Import tasks from '../../RedHat/generic/configure-uuidd.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-uuidd.yml
tags:
- sap_general_preconfigure_configure_uuidd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-7
ansible.builtin.debug:
msg: "SAP note 3562909 Step 7: Configure tmpfs;
memtotal_mb = {{ ansible_memtotal_mb }};
swaptotal_mb = {{ ansible_swaptotal_mb }};
sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}"
tags:
- sap_general_preconfigure_configure_tmpfs

- name: Import tasks from '../../RedHat/generic/assert-tmpfs.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-tmpfs.yml
tags:
- sap_general_preconfigure_configure_tmpfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-7
ansible.builtin.debug:
msg: "SAP note 3562909 Step 7: Configure tmpfs;
memtotal_mb = {{ ansible_memtotal_mb }};
swaptotal_mb = {{ ansible_swaptotal_mb }};
sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}"
tags:
- sap_general_preconfigure_configure_tmpfs

- name: Import tasks from '../../RedHat/generic/configure-tmpfs.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-tmpfs.yml
tags:
- sap_general_preconfigure_configure_tmpfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-8
ansible.builtin.debug:
msg: "SAP note 3562909 Step 8: Configure Linux Kernel Parameters"
tags:
- sap_general_preconfigure_kernel_parameters

- name: Import tasks from '../../RedHat/generic/assert-kernel-parameters.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-kernel-parameters.yml
tags:
- sap_general_preconfigure_kernel_parameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-8
ansible.builtin.debug:
msg: "SAP note 3562909 Step 8: Configure Linux Kernel Parameters"
tags:
- sap_general_preconfigure_kernel_parameters

- name: Import tasks from '../../RedHat/generic/configure-kernel-parameters.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-kernel-parameters.yml
tags:
- sap_general_preconfigure_kernel_parameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-9
ansible.builtin.debug:
msg: "SAP note 3562909 Step 9: Configure Process Resource Limits"
tags:
- sap_general_preconfigure_nproc_limits

- name: Import tasks from '../../RedHat/generic/assert-limits-conf-file.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-limits-conf-file.yml
tags:
- sap_general_preconfigure_nproc_limits

- name: Import tasks from '../../RedHat/generic/assert-nproc-limits.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-nproc-limits.yml
tags:
- sap_general_preconfigure_nproc_limits
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-9
ansible.builtin.debug:
msg: "SAP note 3562909 Step 9: Configure Process Resource Limits"
tags:
- sap_general_preconfigure_nproc_limits

- name: Import tasks from '../../RedHat/generic/increase-nproc-limits.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/increase-nproc-limits.yml
tags:
- sap_general_preconfigure_nproc_limits
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Assert 3562909-10
ansible.builtin.debug:
msg: "SAP note 3562909 Step 10: Configure systemd-tmpfiles"
tags:
- sap_general_preconfigure_systemd_tmpfiles

- name: Import tasks from '../../RedHat/generic/assert-systemd-tmpfiles.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/assert-systemd-tmpfiles.yml
tags:
- sap_general_preconfigure_systemd_tmpfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: Configure 3562909-10
ansible.builtin.debug:
msg: "SAP note 3562909 Step 10: Configure systemd-tmpfiles"
tags:
- sap_general_preconfigure_systemd_tmpfiles

- name: Import tasks from '../../RedHat/generic/configure-systemd-tmpfiles.yml'
ansible.builtin.import_tasks: ../../RedHat/generic/configure-systemd-tmpfiles.yml
tags:
- sap_general_preconfigure_systemd_tmpfiles
Loading
Loading