Skip to content

feat: Decouple disk wiping from LSO installation#825

Open
akrzos wants to merge 1 commit into
redhat-performance:mainfrom
akrzos:decouple_disk_wipe_from_lso
Open

feat: Decouple disk wiping from LSO installation#825
akrzos wants to merge 1 commit into
redhat-performance:mainfrom
akrzos:decouple_disk_wipe_from_lso

Conversation

@akrzos
Copy link
Copy Markdown
Member

@akrzos akrzos commented May 14, 2026

Disk preparation (wiping, partitioning, LVM setup) is now triggered by populating device lists alone, without requiring a separate boolean. LSO installation is controlled independently by the new setup_lso toggle, following the established setup_odf/setup_minio pattern.

This enables three install paths:

  • Just install a cluster (default)
  • Install + wipe disks (populate device lists, no LSO)
  • Install + LSO (setup_lso: true, with or without disk wiping)

Removes controlplane_localstorage_configuration and worker_localstorage_configuration variables.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Local storage configuration model simplified: disk preparation now triggered by device lists instead of boolean configuration flags
    • New setup_lso variable independently controls Local Storage Operator installation
    • Local storage disk preparation decoupled from operator installation for greater flexibility
  • Documentation

    • Updated local storage documentation with new configuration examples and variable reference
    • Clarified Local Storage Operator prerequisites and setup requirements

Review Change Stack

Disk preparation (wiping, partitioning, LVM setup) is now triggered by
populating device lists alone, without requiring a separate boolean.
LSO installation is controlled independently by the new setup_lso toggle,
following the established setup_odf/setup_minio pattern.

This enables three install paths:
- Just install a cluster (default)
- Install + wipe disks (populate device lists, no LSO)
- Install + LSO (setup_lso: true, with or without disk wiping)

Removes controlplane_localstorage_configuration and
worker_localstorage_configuration variables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested review from jtaleric and rsevilla87 May 14, 2026 01:12
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign josecastillolema for approval. For more information see the 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

@akrzos akrzos requested review from mcornea and removed request for jtaleric and rsevilla87 May 14, 2026 01:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

📝 Walkthrough

Walkthrough

This PR refactors the local storage configuration model to separate disk preparation concerns from Local Storage Operator installation. Boolean configuration flags are removed in favor of device-list-based triggers for Ignition-driven disk setup, and a new setup_lso flag explicitly controls LSO post-install installation. Documentation is updated to describe these as independent workflows.

Changes

Local Storage Configuration Refactoring: Separate Disk Preparation from LSO Installation

Layer / File(s) Summary
Refactor disk preparation to use device list checks
ansible/roles/configure-local-storage/defaults/main.yml, ansible/roles/configure-local-storage/tasks/main.yml, ansible/roles/configure-local-storage/templates/controlplane.ign.j2
Removed controlplane_localstorage_configuration and worker_localstorage_configuration boolean defaults. Updated task conditions and Ignition template logic to trigger disk setup when NVMe or localstorage device lists are non-empty, eliminating the boolean flag dependency.
Introduce setup_lso flag and refactor LSO installation
ansible/roles/mno-post-cluster-install/defaults/main/main.yml, ansible/roles/mno-post-cluster-install/tasks/main.yml, ansible/roles/sno-post-cluster-install/defaults/main/main.yml, ansible/roles/sno-post-cluster-install/tasks/main.yml, ansible/roles/mno-post-cluster-install/templates/localvolume-lvm.yml.j2
Added setup_lso: false defaults in both MNO and SNO post-cluster roles. Updated LSO setup tasks to gate on setup_lso | bool, with node labeling conditional on device list presence. Updated monitoring configuration conditions to use setup_lso instead of removed disk preparation flags. Updated localvolume-lvm template to check control-plane device list lengths.
Update documentation to reflect disk preparation and LSO as separate concerns
docs/local-storage.md, docs/odf.md
Reorganized docs/local-storage.md variables section to separate disk-preparation parameters from LSO installation parameters; removed deprecated *_localstorage_configuration documentation; corrected worker LVM example variable name; added "Wipe only, no LSO" example. Updated docs/odf.md prerequisites and configuration example to use setup_lso: true instead of removed flags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

lgtm, approved

Suggested reviewers

  • mcornea

Poem

🐰 A storage refactor hops into view,
Flags fade away—now lists tell what's true,
Boot-time disks and post-install LSO,
Two separate journeys, now clear as they go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Decouple disk wiping from LSO installation' accurately and concisely summarizes the main change: separating disk preparation from Local Storage Operator installation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ansible/roles/mno-post-cluster-install/tasks/main.yml`:
- Line 218: The when condition uses raw vars and can mis-evaluate string values;
update the condition to coerce operands to booleans by applying the | bool
filter to migrate_monitoring, apply_cluster_monitoring_config and setup_lso so
the expression becomes: (migrate_monitoring | bool) or
((apply_cluster_monitoring_config | bool) and (setup_lso | bool)); this ensures
CLI-passed strings like "false" are treated correctly.

In `@ansible/roles/sno-post-cluster-install/tasks/main.yml`:
- Line 165: The when condition uses string-truthiness for
apply_cluster_monitoring_config and setup_lso; change it to use explicit boolean
coercion by adding the Jinja bool filter so the condition reads like: when:
apply_cluster_monitoring_config | bool and setup_lso | bool; this matches
adjacent checks (e.g., sno_metal3 | bool, setup_minio | bool) and prevents
extra-var string "false" from evaluating as true.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 772ed91e-493a-476a-b3e0-1336288f254a

📥 Commits

Reviewing files that changed from the base of the PR and between 41cc2ed and 76180aa.

📒 Files selected for processing (10)
  • ansible/roles/configure-local-storage/defaults/main.yml
  • ansible/roles/configure-local-storage/tasks/main.yml
  • ansible/roles/configure-local-storage/templates/controlplane.ign.j2
  • ansible/roles/mno-post-cluster-install/defaults/main/main.yml
  • ansible/roles/mno-post-cluster-install/tasks/main.yml
  • ansible/roles/mno-post-cluster-install/templates/localvolume-lvm.yml.j2
  • ansible/roles/sno-post-cluster-install/defaults/main/main.yml
  • ansible/roles/sno-post-cluster-install/tasks/main.yml
  • docs/local-storage.md
  • docs/odf.md


- name: Apply OpenShift-Monitoring configuration options
when: migrate_monitoring or (apply_cluster_monitoring_config and (controlplane_localstorage_configuration or worker_localstorage_configuration))
when: migrate_monitoring or (apply_cluster_monitoring_config and setup_lso)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification: find how these vars are passed in docs/scripts/inventory.
rg -n -C2 'setup_lso\s*='
rg -n -C2 'apply_cluster_monitoring_config\s*='
rg -n -C2 -- '--extra-vars|-e'

Repository: redhat-performance/jetlag

Length of output: 50383


🏁 Script executed:

# Read the specific file and surrounding context
head -n 230 ansible/roles/mno-post-cluster-install/tasks/main.yml | tail -n 20

Repository: redhat-performance/jetlag

Length of output: 1320


🏁 Script executed:

# Find where these variables are defined with defaults
fd -t f -e yml -e yaml | xargs rg -l "setup_lso|apply_cluster_monitoring_config" | grep -E "(defaults|vars)" | head -10

Repository: redhat-performance/jetlag

Length of output: 193


🏁 Script executed:

# Check the role's defaults
rg -n "setup_lso|apply_cluster_monitoring_config" ansible/roles/mno-post-cluster-install/ --type yaml

Repository: redhat-performance/jetlag

Length of output: 583


🏁 Script executed:

# Find variable documentation in tips-and-vars.md
rg -n "setup_lso|apply_cluster_monitoring_config" docs/

Repository: redhat-performance/jetlag

Length of output: 1291


Cast monitoring gate operands to booleans.

Line 218 uses raw vars in when; when variables are passed via CLI extra-vars (e.g., -e setup_lso=false), they arrive as strings, and string truthiness will make this task run unexpectedly. Note that line 149 in this same file correctly applies the | bool filter to setup_lso.

Suggested fix
 - name: Apply OpenShift-Monitoring configuration options
-  when: migrate_monitoring or (apply_cluster_monitoring_config and setup_lso)
+  when: (migrate_monitoring | bool) or ((apply_cluster_monitoring_config | bool) and (setup_lso | bool))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
when: migrate_monitoring or (apply_cluster_monitoring_config and setup_lso)
- name: Apply OpenShift-Monitoring configuration options
when: (migrate_monitoring | bool) or ((apply_cluster_monitoring_config | bool) and (setup_lso | bool))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ansible/roles/mno-post-cluster-install/tasks/main.yml` at line 218, The when
condition uses raw vars and can mis-evaluate string values; update the condition
to coerce operands to booleans by applying the | bool filter to
migrate_monitoring, apply_cluster_monitoring_config and setup_lso so the
expression becomes: (migrate_monitoring | bool) or
((apply_cluster_monitoring_config | bool) and (setup_lso | bool)); this ensures
CLI-passed strings like "false" are treated correctly.


- name: Apply OpenShift-Monitoring configuration options
when: apply_cluster_monitoring_config and controlplane_localstorage_configuration
when: apply_cluster_monitoring_config and setup_lso
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification for bool-like extra-vars usage patterns.
rg -n -C2 'setup_lso\s*='
rg -n -C2 'apply_cluster_monitoring_config\s*='
rg -n -C2 -- '--extra-vars|-e'

Repository: redhat-performance/jetlag

Length of output: 50383


🏁 Script executed:

# Read the specific file and line in question
wc -l ansible/roles/sno-post-cluster-install/tasks/main.yml

Repository: redhat-performance/jetlag

Length of output: 127


🏁 Script executed:

# Get context around line 165
sed -n '155,175p' ansible/roles/sno-post-cluster-install/tasks/main.yml

Repository: redhat-performance/jetlag

Length of output: 925


🏁 Script executed:

# Find where these variables are defined
rg -l "apply_cluster_monitoring_config|setup_lso" --type yml

Repository: redhat-performance/jetlag

Length of output: 97


🏁 Script executed:

# Check defaults for these variables
fd 'defaults' -t d ansible/roles/sno-post-cluster-install/ -exec find {} -name "*.yml" -o -name "*.yaml" \;

Repository: redhat-performance/jetlag

Length of output: 300


🏁 Script executed:

# Check the defaults/main.yml for the sno-post-cluster-install role
find ansible/roles/sno-post-cluster-install -name "defaults" -o -name "vars"

Repository: redhat-performance/jetlag

Length of output: 117


🏁 Script executed:

# List all files in the role directory
ls -la ansible/roles/sno-post-cluster-install/

Repository: redhat-performance/jetlag

Length of output: 357


🏁 Script executed:

# Check for defaults/main.yml
cat ansible/roles/sno-post-cluster-install/defaults/main.yml 2>/dev/null || echo "No defaults file"

Repository: redhat-performance/jetlag

Length of output: 86


🏁 Script executed:

# Search for where these variables are set in the entire codebase
rg "apply_cluster_monitoring_config\s*=" --type yaml

Repository: redhat-performance/jetlag

Length of output: 51


🏁 Script executed:

# Check for extra-vars usage patterns in playbooks
rg "extra-vars|ansible-playbook.*-e" ansible/ | head -20

Repository: redhat-performance/jetlag

Length of output: 261


🏁 Script executed:

# Check what's inside the defaults directory
ls -la ansible/roles/sno-post-cluster-install/defaults/

Repository: redhat-performance/jetlag

Length of output: 231


🏁 Script executed:

# Check the main.yml in defaults
cat ansible/roles/sno-post-cluster-install/defaults/main.yml

Repository: redhat-performance/jetlag

Length of output: 158


🏁 Script executed:

# Search for where apply_cluster_monitoring_config is used across all playbooks
rg "apply_cluster_monitoring_config" ansible/ -B 2 -A 2

Repository: redhat-performance/jetlag

Length of output: 2240


🏁 Script executed:

# Check how variables are typically passed in the main playbooks
rg "sno-post-cluster-install" ansible/ | head -5

Repository: redhat-performance/jetlag

Length of output: 371


🏁 Script executed:

# Check setup_lso definition
rg "setup_lso\s*:" ansible/roles/sno-post-cluster-install/defaults/ -A 1

Repository: redhat-performance/jetlag

Length of output: 421


🏁 Script executed:

# See the full context of the defaults file
cat ansible/roles/sno-post-cluster-install/defaults/main/main.yml | head -100

Repository: redhat-performance/jetlag

Length of output: 1506


🏁 Script executed:

# Check if there are other uses of these variables without | bool filter
rg "when:.*setup_lso" ansible/

Repository: redhat-performance/jetlag

Length of output: 467


Add explicit boolean coercion to monitoring condition.

Line 165 uses the same string-truthiness pattern as nearby tasks but without the | bool filter. When apply_cluster_monitoring_config or setup_lso are passed via extra-vars (e.g., -e apply_cluster_monitoring_config=false), they arrive as strings, and non-empty strings are truthy in Ansible conditions—causing the monitoring config to apply unintentionally. Other tasks in the same file (sno_metal3 | bool, setup_minio | bool, setup_lso | bool) consistently use the filter for this reason.

Suggested fix
 - name: Apply OpenShift-Monitoring configuration options
-  when: apply_cluster_monitoring_config and setup_lso
+  when: (apply_cluster_monitoring_config | bool) and (setup_lso | bool)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
when: apply_cluster_monitoring_config and setup_lso
- name: Apply OpenShift-Monitoring configuration options
when: (apply_cluster_monitoring_config | bool) and (setup_lso | bool)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ansible/roles/sno-post-cluster-install/tasks/main.yml` at line 165, The when
condition uses string-truthiness for apply_cluster_monitoring_config and
setup_lso; change it to use explicit boolean coercion by adding the Jinja bool
filter so the condition reads like: when: apply_cluster_monitoring_config | bool
and setup_lso | bool; this matches adjacent checks (e.g., sno_metal3 | bool,
setup_minio | bool) and prevents extra-var string "false" from evaluating as
true.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant