Skip to content

Commit 2ad5941

Browse files
authored
Merge pull request #1033 from marcelmamula/oracle_vars
sap_anydb_install_oracle: Add handling of OS specific vars
2 parents 55a7cce + 0193865 commit 2ad5941

File tree

4 files changed

+125
-35
lines changed

4 files changed

+125
-35
lines changed

roles/sap_anydb_install_oracle/tasks/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
# SPDX-License-Identifier: Apache-2.0
22
---
33

4+
# Example of files loading order:
5+
# 1. Suse.yml / RedHat.yml - Specific to OS family.
6+
# 2. SLES_15.yml / RedHat_9.yml - Specific to distribution (SLES, SLES_SAP or RedHat) and major release.
7+
# 3. SLES_15.6.yml / RedHat_9.2 - Specific to distribution (SLES, SLES_SAP or RedHat) and minor release.
8+
# 4. SLES_SAP_15.yml - Specific to distribution SLES_SAP and major release.
9+
# 5. SLES_SAP_15.6.yml - Specific to distribution SLES_SAP and minor release.
10+
- name: Include OS specific vars
11+
ansible.builtin.include_vars: "{{ __vars_file }}"
12+
loop: "{{ __var_files }}"
13+
vars:
14+
__vars_file: "{{ role_path }}/vars/{{ item }}"
15+
__distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}"
16+
__distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}"
17+
# Enables loading of shared vars between SLES and SLES_SAP
18+
__distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}"
19+
__distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}"
20+
__var_files: >-
21+
{{
22+
[
23+
ansible_os_family ~ '.yml',
24+
(ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None,
25+
(__distribution_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None,
26+
(__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None,
27+
__distribution_major ~ '.yml',
28+
__distribution_minor ~ '.yml'
29+
] | select('defined') | select('string') | list
30+
}}
31+
when: __vars_file is file
32+
433
- name: Oracle DB - Pre-installation
534
ansible.builtin.include_tasks: "oracledb_install_pre.yml"
635

roles/sap_anydb_install_oracle/tasks/oracledb_install_pre.yml

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,33 @@
11
# SPDX-License-Identifier: Apache-2.0
22
---
33

4-
# See further:
5-
## oracle-database-preinstall-12cr1.rpm
6-
## oracle-database-preinstall-12cr2.rpm
7-
## oracle-database-preinstall-19c.rpm >> https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
4+
# SUSE Specific - zypper pattern installation
5+
# Pattern installation will run only if pattern is not installed
6+
# This ensures that command module shows correct changed status
7+
- name: Query installed zypper patterns
8+
ansible.builtin.command:
9+
cmd: zypper patterns --installed-only
10+
register: __sap_anydb_install_oracle_register_patterns
11+
changed_when: false
12+
ignore_errors: true
13+
when: ansible_os_family == 'Suse'
14+
15+
- name: Ensure that the required zypper patterns are installed
16+
ansible.builtin.command:
17+
cmd: zypper install -y -t pattern {{ item }}
18+
loop: "{{ __sap_anydb_install_oracle_patterns }}"
19+
when:
20+
- ansible_os_family == 'Suse'
21+
- item not in __sap_anydb_install_oracle_register_patterns.stdout
22+
changed_when: item not in __sap_anydb_install_oracle_register_patterns.stdout
23+
24+
825
- name: Install C Shell (CSH), Korn Shell (KSH) and other dependencies for Oracle DB
926
ansible.builtin.package:
10-
name:
11-
- csh
12-
- ksh
13-
- mksh
14-
- bc
15-
- bind-utils
16-
- gcc
17-
- gcc-c++
18-
- glibc-devel
19-
- libcap
20-
- libaio
21-
- libaio-devel
22-
- libgcc
23-
- libstdc++
24-
- libstdc++-devel
25-
- make
26-
- psmisc
27-
- rdma-core-devel
28-
- smartmontools
29-
- sysstat
30-
- unzip
31-
- xorg-x11-utils
32-
- xorg-x11-xauth
33-
- unixODBC
34-
- unixODBC-devel
35-
- libnsl
27+
name: "{{ __sap_anydb_install_oracle_packages | d([]) }}"
3628
state: present
3729
notify: __sap_anydb_install_oracle_reboot_handler
3830

39-
# Removed Packages from RHEL 8.x
40-
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
41-
# - compat-libcap1
42-
# - compat-libstdc++-33
43-
4431

4532
- name: Oracle DB - Create Linux User Groups
4633
become_user: root
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
---
3+
4+
# List of required packages to install
5+
__sap_anydb_install_oracle_packages:
6+
- csh
7+
- ksh
8+
- mksh
9+
- bc
10+
- bind-utils
11+
- gcc
12+
- gcc-c++
13+
- glibc-devel
14+
- libcap
15+
- libaio
16+
- libaio-devel
17+
- libgcc
18+
- libstdc++
19+
- libstdc++-devel
20+
- make
21+
- psmisc
22+
- rdma-core-devel
23+
- smartmontools
24+
- sysstat
25+
- unzip
26+
- xorg-x11-utils
27+
- xorg-x11-xauth
28+
- unixODBC
29+
- unixODBC-devel
30+
- libnsl
31+
32+
# See further:
33+
## oracle-database-preinstall-12cr1.rpm
34+
## oracle-database-preinstall-12cr2.rpm
35+
## oracle-database-preinstall-19c.rpm >> https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm
36+
37+
# Removed Packages from RHEL 8.x
38+
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
39+
# - compat-libcap1
40+
# - compat-libstdc++-33
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
---
3+
4+
# List of required packages to install
5+
__sap_anydb_install_oracle_packages:
6+
- tcsh
7+
- ksh
8+
- mksh
9+
- bc
10+
- bind-utils
11+
- gcc
12+
- gcc-c++
13+
- glibc-devel
14+
- libcap2
15+
- libaio
16+
- libaio-devel
17+
- libgcc_s1
18+
- libstdc++6
19+
- libstdc++-devel
20+
- make
21+
- psmisc
22+
- rdma-core-devel
23+
- smartmontools
24+
- sysstat
25+
- unzip
26+
- unixODBC
27+
- unixODBC-devel
28+
- libnsl2
29+
30+
# List of required zypper patterns
31+
# NOTE: Pattern oracle_server (orarun package) is not compatible with saptune NETWEAVER,
32+
# because SUSE does not support Single-host SAP System with Oracle database.
33+
__sap_anydb_install_oracle_patterns:
34+
- oracle_server

0 commit comments

Comments
 (0)