Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9c35592
omnia automation prereq tool
balajikumaran-c-s Dec 8, 2025
b77d8d5
omnia_sh changes
Dec 10, 2025
eef3b51
Refactor pytest framework with professional standards and HTML reporting
balajikumaran-c-s Dec 11, 2025
6199424
feat: Refactor molecule testing with modular scenarios and enhanced r…
balajikumaran-c-s Dec 12, 2025
29ef187
chore: Consolidate requirements.txt with pinned versions
balajikumaran-c-s Dec 12, 2025
8ebc34c
chore: Add setup_env.sh, remove PYTHONPATH from molecule configs
balajikumaran-c-s Dec 12, 2025
3b61ba7
docs: Update README with molecule testing and cleanup
balajikumaran-c-s Dec 12, 2025
1794600
docs: Add workflow diagram and overview section
balajikumaran-c-s Dec 12, 2025
d69569d
fix: pylint fixes and code cleanup
balajikumaran-c-s Dec 12, 2025
1dd77ae
prepare_oim automation scenario
Diya-Sumod Dec 13, 2025
c42c577
Merge pull request #1 from Diya-Sumod/automation
balajikumaran-c-s Dec 15, 2025
c79c354
Add vault key generation, update molecule tests, and fix run_molecule…
balajikumaran-c-s Dec 15, 2025
bdc0272
Fix pylint score host.py, update software_config path to project_default
balajikumaran-c-s Dec 15, 2025
42926cd
Reorganize automation_library: modular structure + pylint improvements
balajikumaran-c-s Dec 22, 2025
f2cf5d1
Improve pylint scores for omnia_sh files
balajikumaran-c-s Dec 22, 2025
1137c25
Fix run_prereq_check.py import path after reorganization
balajikumaran-c-s Dec 22, 2025
79abd1c
modified user_config
balajikumaran-c-s Dec 22, 2025
4366eb9
Update user_config.yml
balajikumaran-c-s Dec 22, 2025
e66538b
local_repo changes
Tanmay-Raj1004 Dec 22, 2025
a26e59c
Restructure prepare_oim into modular folder structure
Diya-Sumod Dec 22, 2025
6c6c825
refactor: reorganize local_repo module structure and update imports
Tanmay-Raj1004 Dec 22, 2025
13910c6
Fix ansible-lint and pylint issues for prepare_oim and omnia_sh_install
Diya-Sumod Dec 22, 2025
9ed696b
Remove unused automation_library/functions and messages directories
Diya-Sumod Dec 22, 2025
3ea3f86
Merge pull request #7 from Diya-Sumod/automation
balajikumaran-c-s Dec 22, 2025
8cb6502
Merge pull request #6 from Tanmay-Raj1004/automation
balajikumaran-c-s Dec 22, 2025
5704dbf
Delete automation_library/vars directory
balajikumaran-c-s Dec 22, 2025
b3f908a
Add Apache 2.0 license headers to all source files
balajikumaran-c-s Dec 23, 2025
95f0334
Fix ansible-lint violations in omnia_sh_cleanup module
balajikumaran-c-s Dec 23, 2025
e6ca13d
Update user_config.yml
balajikumaran-c-s Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ dist/

# Test cache
.pytest_cache/

# Test reports (generated)
reports/
.venv/
212 changes: 211 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,211 @@
### Omnia Automation
# Omnia Automation Framework

Automation library for OIM (Omnia Infrastructure Manager) deployment, testing, and management.

## Overview

This framework provides:
- **Prerequisite Validation** - Validates OIM server meets all requirements
- **Container Image Build** - Clones repository and builds Omnia container images
- **Automated Testing** - Molecule-based infrastructure testing with detailed reports

## Quick Start

```bash
# 1. Clone the repository
git clone https://github.com/dell/omnia-artifactory.git
cd omnia-artifactory

# 2. Setup virtual environment
./setup_env.sh
source .venv/bin/activate

# 3. Configure your settings
vi user_config.yml

# 4. Run prerequisite checks
oim-prereq-check

# 5. Run molecule tests (optional)
./run_molecule.sh all test
```

## Workflow

```
┌─────────────────────────────────────────────────────────────┐
│ 1. CONFIGURE │
│ Edit user_config.yml with target server details │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ 2. PREREQUISITE CHECK (oim-prereq-check) │
│ • Validates hardware, OS, network │
│ • Configures PXE interface │
│ • Verifies NFS connectivity │
│ • Clones omnia-artifactory repository │
│ • Builds container images │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ ✓ OIM SERVER READY FOR DEPLOYMENT │
│ All prerequisites passed. Server is ready for omnia.sh │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ 3. MOLECULE TESTS (optional) │
│ • Runs omnia.sh installation │
│ • Validates deployment │
│ • Generates HTML/JSON reports │
└─────────────────────────────────────────────────────────────┘
```

## Installation

```bash
# Option 1: Using setup script (recommended)
./setup_env.sh
source .venv/bin/activate

# Option 2: Manual installation
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

## Molecule Testing

Run automated infrastructure tests:

```bash
# List available scenarios
./run_molecule.sh list

# Run all scenarios
./run_molecule.sh all test

# Run specific scenario
./run_molecule.sh <scenario> test

# Other commands
./run_molecule.sh <scenario> converge # Run playbooks only
./run_molecule.sh <scenario> verify # Run tests only
./run_molecule.sh <scenario> destroy # Cleanup
```

### Test Reports

After running tests, reports are generated in `reports/`:
- `test_report.json` - JSON format
- `test_report.html` - Interactive HTML report

## Configuration

Edit `user_config.yml` in the project root:

```yaml
# Target OIM Server (REQUIRED)
oim_server_ip: "192.168.1.100" # Remote server IP
oim_ssh_user: "root" # SSH username
oim_ssh_password: "your_password" # SSH password

# OS Validation
required_os: "rhel"
required_os_version: "10"
required_kernel_version: "6.12.0-55.9.1.el10_0.x86_64"

# Hardware Requirements
min_cores: 4
min_memory_gb: 8
min_disk_gb: 50

# Network Interfaces
pxe_interface: "eno1"
public_interface: "eno2"
pxe_ip: "172.16.107.254/24"

# NFS Configuration
nfs_server_ip: "192.168.1.200"
nfs_share_path: "/mnt/share"
nfs_min_capacity_gb: 100

# Podman
podman_min_version: "4.0.0"

# Container Image Build (optional)
reconfigure_images: false # Set true to clone repo & build images
artifactory_repo_url: "https://github.com/dell/omnia-artifactory.git"
artifactory_branch: "omnia-container"
omnia_clone_path: "/opt/omnia-artifactory"
container_images: "core"
omnia_branch: "pub/k8s_telemetry" # Required if reconfigure_images is true

# Behavior
skip_on_failure: true # true=continue all checks, false=stop on first failure
```

## Prerequisite Check

Validate OIM server prerequisites before deployment:

```bash
oim-prereq-check # Run all checks
oim-prereq-check --debug # With debug output
oim-prereq-check --help # Show help
```

### Checks Performed

| # | Check | Description |
|---|-------|-------------|
| 1 | IPMI Tool | Verify/install ipmitool |
| 2 | Hardware Inventory | Validate CPU cores, memory, disk space |
| 3 | OS Validation | Validate OS, version, and kernel |
| 4 | Network Interfaces | Validate PXE and Public interfaces exist and are UP |
| 5 | PXE NIC Configuration | Configure PXE interface IP address |
| 6 | NFS Server | Ping NFS server and verify share capacity |
| 7 | Internet Connectivity | Test internet access via public interface |
| 8 | Podman | Validate Podman version |
| 9 | RHEL Repository | Check RHEL repository availability |
| 10 | Git | Verify/install git (if reconfigure_images=true) |
| 11 | Omnia Artifactory | Clone repository & download omnia.sh (if reconfigure_images=true) |
| 12 | Container Images | Build container images (if reconfigure_images=true) |

## Project Structure

```
omnia-artifactory/
├── user_config.yml # ← EDIT THIS FILE
├── requirements.txt # Dependencies
├── setup.py # Package setup
├── setup_env.sh # Virtual environment setup
├── run_molecule.sh # Molecule test runner
├── run_prereq_check.py # Prerequisite check runner
├── README.md
├── automation_library/
│ ├── core/ # Core utilities
│ │ ├── formatting.py # Logging and colors
│ │ ├── host.py # Testinfra host utilities
│ │ └── report.py # Test report generator
│ ├── vars/ # Configuration variables
│ ├── messages/ # User-facing messages
│ └── functions/ # Business logic
├── molecule/
│ ├── conftest.py # Pytest configuration
│ ├── shared/ # Shared tasks
│ └── <scenario>/ # Test scenarios
│ ├── molecule.yml
│ ├── converge.yml
│ └── tests/
└── reports/ # Generated test reports
```

## Requirements

- Python 3.12+
- SSH access to target OIM server
- `sshpass` (auto-installed if needed)

## License

Apache License 2.0
Empty file.
31 changes: 0 additions & 31 deletions automation/setup.py

This file was deleted.

6 changes: 0 additions & 6 deletions automation/test_requirements.txt

This file was deleted.

35 changes: 35 additions & 0 deletions automation_library/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2025 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.

"""
Omnia Automation Library

A Python library for automating OIM prerequisite checks and omnia.sh testing.

Modules:
- core: Formatting, logging, host utilities, reports
- functions: Prereq checks, omnia.sh operations
- messages: User-facing messages
- vars: Configuration variables

Usage:
from automation_library.core import TestLogger, Colors
from automation_library.functions import run_all_prereq_checks
"""

__version__ = "0.1.0"

from .core import Colors, Symbols, log, set_debug_mode, TestLogger

__all__ = ["Colors", "Symbols", "log", "set_debug_mode", "TestLogger", "__version__"]
24 changes: 24 additions & 0 deletions automation_library/checks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2025 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.

"""
OIM Prerequisite Checks Module

This module contains all prerequisite validation checks for OIM deployment.
Organized into logical function groups while preserving the original functionality.
"""

from .functions.main import run_all_prereq_checks

__all__ = ["run_all_prereq_checks"]
48 changes: 48 additions & 0 deletions automation_library/checks/functions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2025 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.

"""
Prerequisite Check Functions

Modular organization of OIM prerequisite validation functions
organized by functionality: system, hardware, network, services, repository, and validation.
"""

# Import all functions to maintain compatibility
from .main import run_all_prereq_checks
from .system import configure_hostname
from .hardware import check_ipmi_tool, install_ipmi_tool, get_hardware_inventory, validate_hardware
from .network import validate_network_interfaces, configure_pxe_nic, check_internet
from .services import check_nfs_reachable
from .repository import ensure_git_installed, clone_omnia_repo, build_container_images, download_omnia_sh
from .validation import validate_os, check_podman

__all__ = [
"run_all_prereq_checks",
"configure_hostname",
"check_ipmi_tool",
"install_ipmi_tool",
"get_hardware_inventory",
"validate_hardware",
"validate_network_interfaces",
"configure_pxe_nic",
"check_internet",
"check_nfs_reachable",
"ensure_git_installed",
"clone_omnia_repo",
"build_container_images",
"download_omnia_sh",
"validate_os",
"check_podman"
]
Loading