-
Notifications
You must be signed in to change notification settings - Fork 171
feat(orchestrator): modernization phases 1-6 — v3.0.0 #4923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sujit-jadhav
wants to merge
12
commits into
dell:issue-4849-omnia-modernization
Choose a base branch
from
sujit-jadhav:feature/galaxy-collections
base: issue-4849-omnia-modernization
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
017548c
feat(orchestrator): modernization phases 1-6 — v3.0.0
sujit-jadhav ad10e2a
fix(orchestrator): resolve all 15 ansible-lint violations
sujit-jadhav 4e0f5f5
fix(orchestrator): add meta/main.yml and README.md for new roles
sujit-jadhav d78719f
fix(orchestrator): Galaxy compliance — score 58 → 78 (COMPLIANT)
sujit-jadhav 44612d1
refactor(orchestrator): input validation four-directory structure — s…
sujit-jadhav 883b9e8
fix(discovery): Galaxy compliance — score 61 → 90 (COMPLIANT)
sujit-jadhav 9eb1488
chore: remove domain-completion-checker from discovery and orchestrator
sujit-jadhav b49a11d
refactor(orchestrator): consume repo_manager output via repo_status.yml
sujit-jadhav 2335503
fix(orchestrator): align repo_status.yml consumption with actual repo…
sujit-jadhav cbb5333
fix: address PR review comments from abhishek-sa1
sujit-jadhav ce624b9
chore: align discovery version to 3.0.0 to match orchestrator
sujit-jadhav 1fc175c
feat(test): add FVT automation for discovery and orchestrator domains
sujit-jadhav 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to the `omnia.discovery` collection will be documented in this file. | ||
|
|
||
| ## [3.0.0] - 2026-07-30 | ||
|
|
||
| ### Added | ||
| - Galaxy collection structure for discovery domain. | ||
| - Self-contained roles: `ome_discovery`, `discovery_setup`, `discovery_common`, `discovery_credentials`, `validate_discovery_input`. | ||
| - Plugins: `generate_discovery_report`, `generate_pxe_mapping`, `ome_server_inventory`, `validate_credentials`, `validate_discovery_config`. | ||
| - Input validation with JSON schemas for `discovery_config.yml` and `credential_rules.json`. | ||
| - L2 semantic validation flow for OME IP reachability checks. | ||
| - Domain-level documentation: `DISCOVERY_DESIGN.md`, `INPUT_CONTRACT.md`, `OUTPUT_CONTRACT.md`. | ||
| - All module references use FQCN (`ansible.builtin.*`). | ||
| - Zero `../common/` cross-domain imports. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # ============================================================================= | ||
| # domain-init.sh — Initialize discovery domain runtime directories and inputs | ||
| # ============================================================================= | ||
| # | ||
| # Copies: | ||
| # 1. input/ config templates → <OMNIA_DATA_PATH>/discovery/input/<project>/ | ||
| # | ||
| # Usage: | ||
| # ./domain-init.sh | ||
| # ./domain-init.sh --force | ||
| # OMNIA_DATA_PATH=/opt/omnia OMNIA_PROJECT_NAME=prod ./domain-init.sh | ||
| # | ||
| # Called automatically by: omnia.sh --setup-venv | ||
| # ============================================================================= | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| readonly DOMAIN_NAME="discovery" | ||
|
|
||
| # --- Resolve environment variables --- | ||
| OMNIA_DATA_PATH="${OMNIA_DATA_PATH:-/opt/omnia}" | ||
| OMNIA_PROJECT_NAME="${OMNIA_PROJECT_NAME:-project_default}" | ||
| FORCE="${1:-}" | ||
|
|
||
| readonly INPUT_SRC="${SCRIPT_DIR}/input" | ||
| readonly INPUT_DST="${OMNIA_DATA_PATH}/input/${OMNIA_PROJECT_NAME}" | ||
| readonly LOG_DIR="/var/log/omnia/${DOMAIN_NAME}" | ||
|
|
||
| # --- Functions --- | ||
| log() { echo "[${DOMAIN_NAME}] $*"; } | ||
|
|
||
| ensure_dir() { | ||
| if [[ ! -d "$1" ]]; then | ||
| mkdir -p "$1" | ||
| log "Created directory: $1" | ||
| fi | ||
| } | ||
|
|
||
| copy_if_missing() { | ||
| local src="$1" dst="$2" | ||
| if [[ ! -f "$dst" ]] || [[ "$FORCE" == "--force" ]]; then | ||
| cp "$src" "$dst" | ||
| log "Copied: $(basename "$src") → $dst" | ||
| else | ||
| log "Skipped (exists): $(basename "$dst")" | ||
| fi | ||
| } | ||
|
|
||
| # --- Main --- | ||
| log "Setting up ${DOMAIN_NAME} domain..." | ||
|
|
||
| # Create required directories | ||
| ensure_dir "$INPUT_DST" | ||
| ensure_dir "$LOG_DIR" | ||
|
|
||
| # Copy input templates (only if not already present) | ||
| if [[ -d "$INPUT_SRC" ]]; then | ||
| for f in "$INPUT_SRC"/*; do | ||
| [[ -f "$f" ]] && copy_if_missing "$f" "${INPUT_DST}/$(basename "$f")" | ||
| done | ||
| else | ||
| log "No input/ directory found — skipping input copy" | ||
| fi | ||
|
|
||
| log "Domain setup complete." |
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
2 changes: 2 additions & 0 deletions
2
src/discovery/plugins/module_utils/discovery_validation/core/__init__.py
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,2 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # Licensed under the Apache License, Version 2.0 |
82 changes: 82 additions & 0 deletions
82
src/discovery/plugins/module_utils/discovery_validation/core/validation_engine.py
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,82 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """ | ||
| Discovery validation engine — runs L1 (schema) and L2 (logic) validation. | ||
|
|
||
| Provides the central ``run_validation()`` dispatcher that loads config files, | ||
| applies JSON schema checks, then runs semantic validators. | ||
| """ | ||
|
|
||
| import ipaddress | ||
| import json | ||
| import os | ||
|
|
||
| import yaml | ||
|
|
||
| from ..messages.discovery_messages import VALIDATOR_EXCEPTION_MSG | ||
|
|
||
|
|
||
| # ── Utility helpers ────────────────────────────────────────────────────────── | ||
|
|
||
| def is_valid_ipv4(addr): | ||
| """Quick check for valid IPv4 address.""" | ||
| try: | ||
| ip = ipaddress.ip_address(addr) | ||
| return ip.version == 4 | ||
| except ValueError: | ||
| return False | ||
|
|
||
|
|
||
| def load_yaml_file(path): | ||
| """Safely load a YAML file, return parsed data or None.""" | ||
| try: | ||
| with open(path, "r", encoding="utf-8") as f: | ||
| return yaml.safe_load(f) | ||
| except (yaml.YAMLError, IOError, OSError): | ||
| return None | ||
|
|
||
|
|
||
| def load_json_schema(schema_path): | ||
| """Load a JSON schema file, return parsed data or None.""" | ||
| try: | ||
| with open(schema_path, "r", encoding="utf-8") as f: | ||
| return json.load(f) | ||
| except (json.JSONDecodeError, IOError, OSError): | ||
| return None | ||
|
|
||
|
|
||
| def run_validation(config_file, config_data, validators, logger=None): | ||
| """ | ||
| Run a list of validator functions against config data. | ||
|
|
||
| Args: | ||
| config_file (str): Name of the config file being validated. | ||
| config_data (dict): Parsed configuration data. | ||
| validators (list): List of callables with signature (data, errors, logger). | ||
| logger: Optional logger instance. | ||
|
|
||
| Returns: | ||
| list: Collected error message strings (empty if valid). | ||
| """ | ||
| errors = [] | ||
| for validator_fn in validators: | ||
| try: | ||
| validator_fn(config_data, errors, logger) | ||
| except Exception as e: | ||
| msg = VALIDATOR_EXCEPTION_MSG.format(config_file, validator_fn.__name__, e) | ||
| errors.append(msg) | ||
| if logger: | ||
| logger.error(msg) | ||
| return errors |
2 changes: 2 additions & 0 deletions
2
src/discovery/plugins/module_utils/discovery_validation/messages/__init__.py
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,2 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # Licensed under the Apache License, Version 2.0 |
33 changes: 33 additions & 0 deletions
33
src/discovery/plugins/module_utils/discovery_validation/messages/discovery_messages.py
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,33 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """ | ||
| Validation error/warning message constants for the discovery domain. | ||
|
|
||
| All message strings are defined here as UPPER_SNAKE_CASE constants to | ||
| keep validator logic free of inline strings. | ||
| """ | ||
|
|
||
| # ── discovery_config.yml messages ──────────────────────────────────────────── | ||
|
|
||
| OME_IP_REQUIRED_MSG = "discovery_config: ome_ip is required when enable_bmc_discovery is true." | ||
| OME_IP_LOOPBACK_MSG = ( | ||
| "discovery_config: ome_ip '{}' is a loopback address. " | ||
| "Provide the actual OME appliance IP." | ||
| ) | ||
| OME_IP_INVALID_MSG = "discovery_config: ome_ip '{}' is not a valid IPv4 address." | ||
|
|
||
| # ── Engine messages ────────────────────────────────────────────────────────── | ||
|
|
||
| VALIDATOR_EXCEPTION_MSG = "{}: Validator {} raised: {}" |
2 changes: 2 additions & 0 deletions
2
src/discovery/plugins/module_utils/discovery_validation/validators/__init__.py
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,2 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # Licensed under the Apache License, Version 2.0 |
72 changes: 72 additions & 0 deletions
72
...covery/plugins/module_utils/discovery_validation/validators/discovery_config_validator.py
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,72 @@ | ||
| # Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """ | ||
| L2 (semantic) validator for discovery_config.yml. | ||
|
|
||
| The ``validate()`` entry point runs all cross-field and semantic checks. | ||
| """ | ||
|
|
||
| import ipaddress | ||
|
|
||
| from ..messages.discovery_messages import ( | ||
| OME_IP_REQUIRED_MSG, | ||
| OME_IP_LOOPBACK_MSG, | ||
| OME_IP_INVALID_MSG, | ||
| ) | ||
|
|
||
|
|
||
| def _validate_ome_ip(config_data, errors, logger=None): | ||
| """ | ||
| Validate OME IP address logic. | ||
|
|
||
| Rules: | ||
| - If enable_bmc_discovery is true, ome_ip must be a valid, non-loopback IPv4. | ||
| - If enable_bmc_discovery is false, ome_ip is ignored. | ||
| """ | ||
| enable_bmc = config_data.get("enable_bmc_discovery", False) | ||
| if not enable_bmc: | ||
| return | ||
|
|
||
| ome_ip = config_data.get("ome_ip", "") | ||
| if not ome_ip: | ||
| errors.append(OME_IP_REQUIRED_MSG) | ||
| if logger: | ||
| logger.error(OME_IP_REQUIRED_MSG) | ||
| return | ||
|
|
||
| try: | ||
| addr = ipaddress.ip_address(ome_ip) | ||
| if addr.is_loopback: | ||
| msg = OME_IP_LOOPBACK_MSG.format(ome_ip) | ||
| errors.append(msg) | ||
| if logger: | ||
| logger.error(msg) | ||
| except ValueError: | ||
| msg = OME_IP_INVALID_MSG.format(ome_ip) | ||
| errors.append(msg) | ||
| if logger: | ||
| logger.error(msg) | ||
|
|
||
|
|
||
| def validate(config_data, errors, logger=None): | ||
| """ | ||
| Run all L2 validators for discovery_config.yml. | ||
|
|
||
| Args: | ||
| config_data (dict): Parsed discovery_config.yml content. | ||
| errors (list): Mutable list to append error messages to. | ||
| logger: Optional logger instance. | ||
| """ | ||
| _validate_ome_ip(config_data, errors, logger) |
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
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,4 @@ | ||
| # Python dependencies for omnia.discovery collection | ||
| ansible-core>=2.20 | ||
| jinja2>=3.0 | ||
| pyyaml>=5.4 |
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,6 @@ | ||
| --- | ||
| collections: | ||
| - name: community.general | ||
| version: ">=5.0.0" | ||
| - name: ansible.posix | ||
| version: ">=1.4.0" |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file name should be domain-init.sh