This repository was archived by the owner on Sep 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
OSAC-43: adds VAST storage provider #296
Merged
openshift-merge-bot
merged 6 commits into
osac-project:main
from
wgordon17:MGMT-23930-ansible-storage-mvp
May 27, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d7e407e
OSAC-43: adds VAST storage provider with per-tenant credential isolation
wgordon17 46b1c36
OSAC-43: fixes pr-review and quality-gate findings for VAST storage p…
wgordon17 77cdf99
OSAC-43: fixes VAST CSI parameters, refactors teardown to live querie…
wgordon17 acfdba3
OSAC-43: moves per-tier VMS resource creation from setup to ensure_st…
wgordon17 fa3a86e
OSAC-43: relax vastdata.vms ansible-core version constraint
akshaynadkarni 0593dc2
OSAC-43: fix misleading security comment in ensure_storage_class
akshaynadkarni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,3 +61,5 @@ jobs: | |
|
|
||
| - name: Run integration tests | ||
| run: uv run make test | ||
| env: | ||
| STORAGE_TESTS_ENABLED: "true" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ions/ansible_collections/osac/config_as_code/roles/aap/templates/storage-operations-ig.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| labels: | ||
| ansible_job: '' | ||
| spec: | ||
| serviceAccountName: osac-sa | ||
| affinity: | ||
| podAntiAffinity: | ||
| preferredDuringSchedulingIgnoredDuringExecution: | ||
| - weight: 100 | ||
| podAffinityTerm: | ||
| labelSelector: | ||
| matchExpressions: | ||
| - key: ansible_job | ||
| operator: Exists | ||
| topologyKey: kubernetes.io/hostname | ||
| containers: | ||
| - image: >- | ||
| {{ aap_ee_image }} | ||
| name: worker | ||
| imagePullPolicy: Always | ||
| args: | ||
| - ansible-runner | ||
| - worker | ||
| - '--private-data-dir=/runner' | ||
| volumeMounts: | ||
| - name: kube-api-access | ||
| mountPath: /var/run/secrets/kubernetes.io/serviceaccount | ||
| readOnly: true | ||
| envFrom: | ||
| - secretRef: | ||
| name: storage-operations-ig | ||
| - configMapRef: | ||
| name: storage-operations-ig | ||
| optional: true | ||
| env: | ||
| - name: OSAC_STORAGE_CONFIG_NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| volumes: | ||
| - name: kube-api-access | ||
| projected: | ||
| sources: | ||
| - serviceAccountToken: | ||
| path: token | ||
| expirationSeconds: 3600 | ||
| - configMap: | ||
| name: kube-root-ca.crt | ||
| items: | ||
| - key: ca.crt | ||
| path: ca.crt | ||
| - downwardAPI: | ||
| items: | ||
| - path: namespace | ||
| fieldRef: | ||
| apiVersion: v1 | ||
| fieldPath: metadata.namespace | ||
| - configMap: | ||
| name: openshift-service-ca.crt | ||
| items: | ||
| - key: service-ca.crt | ||
| path: service-ca.crt | ||
| defaultMode: 420 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
collections/ansible_collections/osac/service/roles/storage_provider/meta/argument_specs.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| argument_specs: | ||
| main: | ||
| short_description: Storage provider interface role | ||
| description: > | ||
| Dispatches storage operations to provider-specific template roles. | ||
| Validates inputs and enforces the provider and protocol allowlists | ||
| before any dynamic role name construction to prevent role-name injection. | ||
| options: | ||
| storage_provider_tiers: | ||
| type: list | ||
| required: true | ||
| description: > | ||
| List of storage tier definitions. Each tier declares its name, protocol, | ||
| provider, and optional QoS/quota settings. The dispatcher groups tiers | ||
| by provider and dispatches to each provider's template role with the | ||
| filtered tier subset. | ||
| Example: [{name: default, protocol: nfs, provider: vast, | ||
| qos_policy: default-qos, | ||
| qos_limits: {static_limits: {max_reads_bw_mbps: 100, max_writes_bw_mbps: 100}}}] | ||
| storage_provider_action: | ||
| type: str | ||
| required: true | ||
| choices: | ||
| - setup | ||
| - ensure_storage_class | ||
| - teardown | ||
| description: > | ||
| Which storage operation to perform. setup provisions provider-side | ||
| resources. ensure_storage_class creates K8s Secret and StorageClass | ||
| on the target cluster (JIT). teardown removes all provisioned resources. | ||
| storage_provider_provisioning_target: | ||
| type: str | ||
| required: true | ||
| choices: | ||
| - vmaas | ||
| - hcp_control_plane | ||
| - hcp_worker_root | ||
| - hcp_data_plane | ||
| description: > | ||
| Provisioning context. vmaas is the default VMaaS path. | ||
| CaaS targets (hcp_control_plane, hcp_worker_root, hcp_data_plane) | ||
| route to HyperShift integration points (stubbed until HyperShift | ||
| storage integration is available). | ||
| storage_provider_block_encryption_passphrase: | ||
| type: str | ||
| required: false | ||
| default: "" | ||
| description: > | ||
| Passphrase for block encryption. Passed from the Tenant CR event payload. | ||
| When empty, block StorageClasses are created without host encryption. | ||
| storage_provider_snapshots_enabled: | ||
| type: bool | ||
| required: false | ||
| default: true | ||
| description: > | ||
| Create a VolumeSnapshotClass alongside the StorageClass for K8s-native | ||
| snapshot support. Skipped if the VolumeSnapshot CRD is not installed. |
52 changes: 52 additions & 0 deletions
52
...ons/ansible_collections/osac/service/roles/storage_provider/tasks/_dispatch_provider.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| # Thin wrapper for per-provider dispatch. Called via include_tasks with loop | ||
| # because Ansible does not support loop: on include_role directly. | ||
| # | ||
| # Receives from caller (via loop_var or set_fact): | ||
| # _current_provider — the provider name for this iteration (e.g. 'vast') | ||
| # _dispatch_action — task file to invoke (setup, ensure_storage_class, teardown) | ||
| # | ||
| # Uses from play scope: | ||
| # storage_provider_tiers — full tier list (filtered here per provider) | ||
| # storage_provider_provisioning_target — provisioning target enum | ||
|
|
||
| - name: "Compute filtered tiers for current provider" | ||
| ansible.builtin.set_fact: | ||
| _computed_provider_tiers: >- | ||
| {{ (storage_provider_tiers | selectattr('provider', 'equalto', _current_provider) | list) | ||
| | selectattr('name', 'in', _requested_tiers) | list | ||
| if (_requested_tiers is defined and _requested_tiers | length > 0) | ||
| else (storage_provider_tiers | selectattr('provider', 'equalto', _current_provider) | list) }} | ||
|
|
||
| - name: "Fail if requested tier filter produced no matches" | ||
| when: >- | ||
| _requested_tiers is defined and _requested_tiers | length > 0 and | ||
| _computed_provider_tiers | length == 0 | ||
| ansible.builtin.fail: | ||
| msg: >- | ||
| None of the requested tiers ({{ _requested_tiers | join(', ') }}) match | ||
| provider '{{ _current_provider }}' tiers. Check STORAGE_TIERS configuration. | ||
|
|
||
| - name: "Dispatch provider storage action" | ||
| ansible.builtin.include_role: | ||
| name: "osac.templates.{{ _current_provider }}_storage" | ||
| tasks_from: "{{ _dispatch_action }}" | ||
|
akshaynadkarni marked this conversation as resolved.
|
||
| public: true | ||
| vars: | ||
| _provider_tiers: "{{ _computed_provider_tiers }}" | ||
| _provisioning_target: "{{ storage_provider_provisioning_target }}" | ||
|
|
||
| - name: "Accumulate tenant config after dispatch (setup only)" | ||
| ansible.builtin.set_fact: | ||
| _all_tenant_configs: >- | ||
| {{ _all_tenant_configs | combine({_current_provider: storage_provider_tenant_config}) }} | ||
| when: | ||
| - _dispatch_action == 'setup' | ||
| - storage_provider_tenant_config is defined | ||
| - storage_provider_tenant_config is mapping | ||
|
|
||
| - name: "Accumulate StorageClass names after dispatch (ensure_storage_class only)" | ||
| ansible.builtin.set_fact: | ||
| _all_sc_names: "{{ _all_sc_names + (storage_provider_storage_class_names | default([])) }}" | ||
| when: | ||
| - _dispatch_action == 'ensure_storage_class' | ||
19 changes: 19 additions & 0 deletions
19
...s/ansible_collections/osac/service/roles/storage_provider/tasks/ensure_storage_class.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| # Dispatches ensure_storage_class to each unique provider in the tier list. | ||
| # Accumulates StorageClass names across all providers into a single list. | ||
|
|
||
| - name: Initialize StorageClass name accumulator | ||
| ansible.builtin.set_fact: | ||
| _all_sc_names: [] | ||
|
|
||
| - name: Dispatch ensure_storage_class to each provider | ||
| block: | ||
| - name: Run ensure_storage_class per provider | ||
| ansible.builtin.include_tasks: _dispatch_provider.yaml | ||
| loop: "{{ _unique_providers }}" | ||
| loop_control: | ||
| loop_var: _current_provider | ||
|
|
||
| - name: Set StorageClass names output (list) | ||
| ansible.builtin.set_fact: | ||
| storage_provider_storage_class_names: "{{ _all_sc_names }}" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.