Skip to content

Commit

Permalink
molecule: dbfs-ol9 for RDBMS prepatch testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Aug 25, 2024
1 parent cd073bc commit ad38f53
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 54 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/molecule_dbfs_ol9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- "molecule: dbfs-ol9 for RDBMS prepatch testing (oravirt#469)"
1 change: 1 addition & 0 deletions doc/development.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ The following szenarios are existing in the `ansible-oracle profect.
|=======================
|Stage |Description
| dbfs | Full stage for installation of RDBMS 19c + Patching and create database. Requires installation media in /vagrant on local host.
| dbfs-ol9 | Full stage for installation of RDBMS 19c + Patching on OL9 and create database. Requires installation media in /vagrant on local host.
| default | Stage for testing common and orahost roles with different Distributions.
| download | Download Patches from support.oracle.com for dbfs stage.
| golden | Create Golden-Image for installation from dbfs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ db_homes_config:
# Oracle JavaVM Component Release Update (OJVM RU) 19.24.0.0.240716
stop_processes: true
state: present
# - patchid: 35261302
# # DATAPUMP BUNDLE PATCH 19.19.0.0.0
# stop_processes: true
# state: present

db1918_si_se2: &db1918_si_se2
version: 19.3.0.0
Expand Down Expand Up @@ -75,15 +71,3 @@ oracle_sw_patches:
patchid: 36414915
version: 19.3.0.0
description: OJVM 19.24
# creates: 36414915/README.txt

# oracle_sw_patches: []
# - patchid: 36582781
# # Database Release Update 19.24.0.0.240716
# patchversion: 19.24.0.0.240716
# stop_processes: true
# state: present
# - patchid: 36414915
# # Oracle JavaVM Component Release Update (OJVM RU) 19.24.0.0.240716
# stop_processes: true
# state: present
5 changes: 5 additions & 0 deletions extensions/molecule/dbfs-ol9/collections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
collections:
# Use current directory as collection source
- source: ./..
type: dir
39 changes: 39 additions & 0 deletions extensions/molecule/dbfs-ol9/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: Converge
hosts: all
gather_facts: true
any_errors_fatal: true
vars:
patch_before_rootsh: true
apply_patches_db: true

db_homes_installed:
- home: db19-si-ee
state: present
apply_patches: true
tasks:

# install missing cron on rhel9 container
- name: Install cron on RHEL/OL9
ansible.builtin.package:
name: cronie
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version | int == 9

- name: Converge os
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.os

- name: Converge swdb
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.swdb
vars:
# install it directly from remote in this test
# => Do not copy the installation media into container
oracle_sw_copy: true
is_sw_source_local: true

- name: Converge sql_zauberkastern
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.sql_zauberkastern

- name: Converge manage_db
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.manage_db
27 changes: 27 additions & 0 deletions extensions/molecule/dbfs-ol9/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
enabled: true

driver:
name: docker
platforms:
- name: dbfs-ol9
image: "${MOLECULE_IMAGE:-quay.io/rendanic/docker-ol9-ansible:latest}"
pre_build_image: true
# The following 4 lines are needed only for making systemd work
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /vagrant:/vagrant:ro
cgroupns_mode: host
privileged: true

verifier:
name: ansible

provisioner:
name: ansible
inventory:
links:
group_vars: ../shared_config/inventory/group_vars/
81 changes: 81 additions & 0 deletions extensions/molecule/dbfs-ol9/side_effect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# This playbook is a special step in molecule.
- name: Side-Effect - DB-Patching 19.20
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.opatch
vars:
is_sw_source_local: true
oracle_sw_copy: true
oracle_sw_unpack: true
db_homes_installed:
- home: db19-si-ee
state: present
apply_patches: true

- name: Side-Effect - DB-Patching 19.20
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.opatch

- name: Side-Effect - Manage-DB
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.manage_db
vars:
restart_spparameter_changed: true
oracle_databases:
- home: db19-si-ee
oracle_db_name: &oracle_db_name DB1
oracle_db_type: SI
is_container: true
storage_type: FS
oracle_database_type: MULTIPURPOSE
redolog_size: 50M
redolog_groups: 3
listener_name: LISTENER
listener_port: &cdb_listener_port 1521
archivelog: false
flashback: false
force_logging: true
state: present
tablespaces:
- name: SYSTEM
size: 10M
autoextend: true
next: 50M
maxsize: 4G
content: permanent
state: present
- name: TEMP
size: 10M
autoextend: true
next: 50M
maxsize: 4G
content: temp
state: present
- name: UNDOTBS1
size: 10M
autoextend: true
next: 50M
maxsize: 4G
content: undo
state: present
init_parameters:
- {name: recyclebin, value: 'off', scope: spfile, state: present}
- {name: sga_target, value: '1808M', scope: spfile, state: present}

oracle_pdbs:
- cdb: DB1
home: db19-si-ee
pdb_name: ORCLPDB
listener_port: 1521
state: present
datafile_dest: /u01/app/oracle/oradata
statspack:
purgedays: 14
snaplevel: 7
tablespace: PERFSTAT
state: present
tablespaces:
- name: PERFSTAT
size: 10M
autoextend: true
next: 50M
maxsize: 4G
content: permanent
state: present
10 changes: 10 additions & 0 deletions extensions/molecule/dbfs-ol9/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@
# is_sw_source_local: false
# oracle_sw_source_www: http://10.0.2.15:8080

oraswdb_golden_image_create: true
golden_image_dest: /u01/golden
is_sw_source_local: true
oracle_sw_copy: true
oracle_sw_unpack: true

# directory for patch download
oracle_sw_source_local: /vagrant

# Directory for Installation-Media
oracle_stage_remote: /vagrant

# Directory for response files, extraceted patches etc.
oracle_stage: /u01/stage

oraswdb_golden_image_create: true
golden_image_dest: /u01/golden

apply_patches_db: true

oracle_sw_patches:
- filename: cvupack_linux_ol7_x86_64.zip
patchid: 30839369
version: 21.0.0.0
description: Latest cluvfy
- filename: p35643107_190000_Linux-x86-64.zip
patchid: 35643107
version: 19.3.0.0
description: Database Release Update 19.21.0.0.231017
- filename: p35648110_190000_Linux-x86-64.zip
patchid: 35648110
- filename: p36582781_190000_Linux-x86-64.zip
patchid: 36582781
version: 19.3.0.0
description: OJVM RELEASE UPDATE 19.21.0.0
creates: 35354406/README.txt
- filename: p35787077_1921000DBRU_Generic.zip
patchid: 35787077
unique_patchid: 25410019
version: 19.3.0.0
description: DATAPUMP BUNDLE PATCH 19.21.0.0.0
- filename: p29213893_1921000DBRU_Generic.zip
patchid: 29213893
unique_patchid: 25362849
version: 19.3.0.0
description: "DBMS_STATS FAILING WITH ERROR ORA-01422"
description: Database Release Update 19.24.0.0.240716

# Important!
# The converge.yml disables the installation of patches.
Expand All @@ -42,7 +38,7 @@ oracle_sw_patches:
db_homes_installed:
- home: db19-si-ee
state: present
apply_patches: false # patching is done in side-effect.yml!
apply_patches: true # patching is done in side-effect.yml!

db_homes_config:
db19-si-ee:
Expand All @@ -54,25 +50,11 @@ db_homes_config:
opatch:
# - {patchid: 29213893, state: absent, excludeUPI: 25224952, stop_processes: true} # 19.3
# - {patchid: 29213893, state: absent, excludeUPI: 24722761, stop_processes: true} # 19.15
- patchid: 35643107
# Database Release Update 19.21.0.0.231017
patchversion: 19.21.0.0.231017
stop_processes: true
state: present
- patchid: 35648110
# Oracle JavaVM Component Release Update (OJVM RU) 19.21.0.0.0.0.231017
stop_processes: true
state: present
- patchid: 35787077
# DATAPUMP BUNDLE PATCH 19.21.0.0.0
stop_processes: false
state: present
excludeUPI: 25410019
- patchid: 29213893
# DBMS_STATS FAILING WITH ERROR ORA-01422"
- patchid: 36582781
# Database Release Update 19.24.0.0.240716
patchversion: 19.24.0.0.240716
stop_processes: true
state: present
excludeUPI: 25362849

oracle_listeners_config:
LISTENER:
Expand Down
1 change: 1 addition & 0 deletions roles/oraswdb_install/tasks/19.3.0.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- ansible_memory_mb.swap.total > 16384
tags:
- assertswap
- molecule-notest

# Do not cleanup patches at the end.
# => We keep them for later patch installation with oradb-manage-patches.
Expand Down

0 comments on commit ad38f53

Please sign in to comment.