Skip to content

Add role to validate minimum free disk space before installation#342

Open
gorjant-pythian wants to merge 1 commit intogoogle:masterfrom
pythian:rel/oratk52-21-simple
Open

Add role to validate minimum free disk space before installation#342
gorjant-pythian wants to merge 1 commit intogoogle:masterfrom
pythian:rel/oratk52-21-simple

Conversation

@gorjant-pythian
Copy link
Copy Markdown
Collaborator

Change Description:

  • Implemented centralized disk space validation and integrated pre-flight checks across software staging, patching, installation, and database creation to fail fast with clear diagnostics instead of proceeding to partial or corrupt operations.
  • Added a reusable role (roles/disk_space_check) and wired it into swlib, patch, rdbms-setup, gi-setup, rac-gi-setup, and db-create. Added Ansible 2.9-safe include_vars fallbacks where needed and updated config-rac-db.yml to run readiness checks and a RAC
    disk-space pre-check. Extended .gitignore for disk-space role Molecule paths.

Solution Overview:

  • Central role: disk_space_check

    • Configurable thresholds per operation in roles/disk_space_check/defaults/main.yml, overridable via vars (MB).
    • Mount-aware checks: gathers mounts, finds the best matching mount (longest prefix) for each path, and supports delegation via disk_check_host.
    • Clear assert-based failures showing required, available, and shortfall; high-usage warnings via disk_space_warning_threshold_percent (default 80%). Can be switched to warn-only via disk_space_fail_on_insufficient: false.
    • Supported types: swlib, oracle_home, gi, rac, patch, db (DB checks run only when ora_disk_management == 'fs').
  • Role integrations

    • swlib: pre-checks swlib_path and swlib_unzip_path capacity (via disk_check_type: swlib).
    • patch: pre-checks patch target home, extraction path, and /tmp (via disk_check_type: patch).
    • rdbms-setup: pre-checks Oracle Home/Base space (via disk_check_type: oracle_home).
    • gi-setup: pre-checks GI requirements (via disk_check_type: gi), plus explicit checks for GI patch extraction and GI software extraction paths.
    • rac-gi-setup: pre-checks RAC GI requirements (via disk_check_type: rac), plus RAC GI patch extraction path checks.
    • db-create: pre-checks data, recovery, and config paths for filesystem-managed deployments (skips when ASM/ASMLib).
  • Default thresholds (overridable):

    • oracle: home 10GB, base 5GB, swlib 20GB, unzip 10GB
    • gi: home 15GB, base 5GB, unzip 10GB
    • rac: grid 20GB, oracle 15GB, unzip 15GB
    • patch: home 5GB, extract 10GB, temp 2GB
    • db: data 20GB, recovery 10GB, config 512MB
  • Ansible 2.9 note: Dynamic role includes (include_role/import_role) do not honor role dependencies declared in meta/main.yml; dependencies are only applied when roles are listed under the play-level roles: key. Because several roles are included dynamically
    and expect baseline variables from the common role, we added a conditional fallback that loads roles/common/defaults via include_vars if oracle_base/oracle_home/grid_home are not defined. This prevents undefined-variable errors while remaining a no-op when
    those vars are already set by inventories, group_vars, or earlier roles. See Ansible 2.9 docs on role dependencies and include_role behavior: role dependencies, include_role, import_role, variable precedence, include_vars.

▌Can you please help me

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Sep 10, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gorjant-pythian
Once this PR has been reviewed and has the lgtm label, please assign alexbasinov for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gorjant-pythian
Copy link
Copy Markdown
Collaborator Author

@simonpane simonpane requested review from mfielding and removed request for mfielding September 15, 2025 15:10
@gorjant-pythian gorjant-pythian self-assigned this Sep 15, 2025
@gorjant-pythian
Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant