Skip to content

Commit 9cf966b

Browse files
authored
Merge pull request #1057 from marcelmamula/sles16
sap_*_preconfigure/SUSE: Update SLES16 pattern names and add packages for hardened images
2 parents b882c58 + 2a5f85e commit 9cf966b

File tree

10 files changed

+50
-10
lines changed

10 files changed

+50
-10
lines changed

roles/sap_general_preconfigure/tasks/SLES/generic/saptune_takeover.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---
33
# 1275776 - Linux: Preparing SLES for SAP environments
44

5+
# saptune_check fails if 'saptune service takeover' was not executed.
56
- name: Execute saptune_check - before takeover
67
ansible.builtin.command:
78
cmd: saptune_check
@@ -10,10 +11,12 @@
1011
changed_when: false
1112
failed_when: false
1213

13-
- name: Takeover and enable saptune
14+
- name: Takeover saptune
1415
when:
1516
- __sap_general_preconfigure_use_saptune
1617
- __sap_general_preconfigure_register_saptune_check_before.rc != 0
18+
# sapconf is not present on SLES 16 and takeover is not required.
19+
- ansible_distribution_major_version | int < 16
1720
block:
1821
- name: Check saptune version # noqa: command-instead-of-module
1922
ansible.builtin.command:
@@ -27,7 +30,7 @@
2730
name: sapconf
2831
state: stopped
2932
enabled: false
30-
when: __sap_general_preconfigure_register_sapconf
33+
when: __sap_general_preconfigure_register_sapconf.rc == 0
3134

3235
- name: Make sure that sapconf and tuned are stopped and disabled
3336
ansible.builtin.command:
@@ -42,13 +45,21 @@
4245
register: __sap_general_preconfigure_register_sapconf_failed
4346
changed_when: false
4447
ignore_errors: true
48+
when: __sap_general_preconfigure_register_sapconf.rc == 0
4549

4650
- name: Execute systemctl reset-failed sapconf.service # noqa command-instead-of-module
4751
ansible.builtin.command:
4852
cmd: systemctl reset-failed sapconf.service
49-
when: __sap_general_preconfigure_register_sapconf_failed.rc == 0
53+
when:
54+
- __sap_general_preconfigure_register_sapconf.rc == 0
55+
- __sap_general_preconfigure_register_sapconf_failed.rc == 0
5056
changed_when: true
5157

58+
59+
- name: Enable saptune service
60+
when:
61+
- __sap_general_preconfigure_use_saptune
62+
block:
5263
- name: Ensure saptune is running and enabled
5364
ansible.builtin.systemd:
5465
name: saptune

roles/sap_general_preconfigure/vars/SLES_15.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ __sap_general_preconfigure_packages:
2323
- bind-utils
2424
- hostname
2525

26+
# Required for zypper ps
27+
- lsof
28+
2629
# Packages specific for SAP Note 2578899
2730
# Their services are enabled using __sap_general_preconfigure_services_2578899
2831
__sap_general_preconfigure_packages_2578899:

roles/sap_general_preconfigure/vars/SLES_SAP_15.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ __sap_general_preconfigure_packages:
2424
- nfs-utils
2525
- bind-utils
2626

27+
# Required for zypper ps
28+
- lsof
29+
2730
# Packages specific for SAP Note 2578899
2831
# Their services are enabled using __sap_general_preconfigure_services_2578899
2932
__sap_general_preconfigure_packages_2578899:

roles/sap_general_preconfigure/vars/SLES_SAP_16.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__sap_general_preconfigure_sapnotes_versions: []
77

88
__sap_general_preconfigure_patterns:
9-
- sles_minimal_sap
9+
- sles_sap_minimal_sap
1010

1111
__sap_general_preconfigure_packages:
1212
# Patterns are not included in package list
@@ -25,6 +25,8 @@ __sap_general_preconfigure_packages:
2525
- nfs-utils
2626
- bind-utils
2727

28+
# Required for zypper ps
29+
- lsof
2830

2931
__sap_general_preconfigure_min_pkgs: []
3032
__sap_general_preconfigure_packagegroups:

roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_takeover.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
changed_when: false
1111
failed_when: false
1212

13-
- name: Takeover and enable saptune
13+
- name: Takeover saptune
1414
when:
1515
- __sap_hana_preconfigure_use_saptune
1616
- __sap_hana_preconfigure_register_saptune_check_before.rc != 0
17+
# sapconf is not present on SLES 16 and takeover is not required.
18+
- ansible_distribution_major_version | int < 16
1719
block:
1820
- name: Check saptune version # noqa: command-instead-of-module
1921
ansible.builtin.command:
@@ -27,7 +29,7 @@
2729
name: sapconf
2830
state: stopped
2931
enabled: false
30-
when: __sap_hana_preconfigure_register_sapconf
32+
when: __sap_hana_preconfigure_register_sapconf.rc == 0
3133

3234
- name: Make sure that sapconf and tuned are stopped and disabled
3335
ansible.builtin.command:
@@ -49,6 +51,11 @@
4951
when: __sap_hana_preconfigure_register_sapconf_failed.rc == 0
5052
changed_when: true
5153

54+
55+
- name: Enable saptune service
56+
when:
57+
- __sap_hana_preconfigure_use_saptune
58+
block:
5259
- name: Ensure saptune is running and enabled
5360
ansible.builtin.systemd:
5461
name: saptune

roles/sap_hana_preconfigure/vars/SLES_15.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ __sap_hana_preconfigure_packages_2684254:
9292
- libssh2-1
9393
- libopenssl1_1
9494
- insserv-compat
95+
- libltdl7
9596

9697
__sap_hana_preconfigure_min_pkgs:
9798

roles/sap_hana_preconfigure/vars/SLES_SAP_15.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ __sap_hana_preconfigure_packages_2684254:
5858
- libssh2-1
5959
- libopenssl1_1
6060
- insserv-compat
61+
- libltdl7
6162

6263

6364
__sap_hana_preconfigure_min_pkgs:

roles/sap_hana_preconfigure/vars/SLES_SAP_16.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
# - SUSE Linux Enterprise Server for SAP Applications 16
55

66
__sap_hana_preconfigure_sapnotes_versions: []
7+
# 3577842 - - SAP HANA DB: Recommended OS settings for SLES 16 / SLES for SAP Applications 16
8+
# - { number: '3577842', version: '1' }
79

810
__sap_hana_preconfigure_min_pkgs:
911

1012
__sap_hana_preconfigure_patterns:
11-
- sles_minimal_sap
13+
- sles_sap_minimal_sap
1214
- sles_sap_DB
1315

1416
__sap_hana_preconfigure_packages:
@@ -24,6 +26,9 @@ __sap_hana_preconfigure_packages:
2426
- sysstat
2527
- sysctl-logger
2628

29+
# 3577842
30+
- libltdl7
31+
2732
# 3139184 - Linux: systemd integration for sapstartsrv and SAP Host Agent
2833
- polkit
2934

roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_takeover.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
changed_when: false
1111
failed_when: false
1212

13-
- name: Takeover and enable saptune
13+
- name: Takeover saptune
1414
when:
1515
- __sap_netweaver_preconfigure_use_saptune
1616
- __sap_netweaver_preconfigure_register_saptune_check_before.rc != 0
17+
# sapconf is not present on SLES 16 and takeover is not required.
18+
- ansible_distribution_major_version | int < 16
1719
block:
1820
- name: Check saptune version # noqa: command-instead-of-module
1921
ansible.builtin.command:
@@ -27,7 +29,7 @@
2729
name: sapconf
2830
state: stopped
2931
enabled: false
30-
when: __sap_netweaver_preconfigure_register_sapconf
32+
when: __sap_netweaver_preconfigure_register_sapconf.rc == 0
3133

3234
- name: Make sure that sapconf and tuned are stopped and disabled
3335
ansible.builtin.command:
@@ -49,6 +51,11 @@
4951
when: __sap_netweaver_preconfigure_register_sapconf_failed.rc == 0
5052
changed_when: true
5153

54+
55+
- name: Enable saptune service
56+
when:
57+
- __sap_netweaver_preconfigure_use_saptune
58+
block:
5259
- name: Ensure saptune is running and enabled
5360
ansible.builtin.systemd:
5461
name: saptune

roles/sap_netweaver_preconfigure/vars/SLES_SAP_16.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__sap_netweaver_preconfigure_sapnotes_versions: []
77

88
__sap_netweaver_preconfigure_patterns:
9-
- sles_minimal_sap
9+
- sles_sap_minimal_sap
1010
- sles_sap_APP
1111

1212
__sap_netweaver_preconfigure_packages:

0 commit comments

Comments
 (0)