Skip to content

feat(repo manager) - Add catalog management operations to repo_manager - #5083

Merged
Venu-p1 merged 4 commits into
dell:issue-4849-omnia-modernizationfrom
Venu-p1:dev/repo-manager/catalog-util
Aug 28, 2026
Merged

feat(repo manager) - Add catalog management operations to repo_manager#5083
Venu-p1 merged 4 commits into
dell:issue-4849-omnia-modernizationfrom
Venu-p1:dev/repo-manager/catalog-util

Conversation

@Venu-p1

@Venu-p1 Venu-p1 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

PR Description


Title: feat: Add catalog management operations to repo_manager

Description:

Introduces catalog generation and editing capabilities within the repo_manager Galaxy collection, enabling users to generate, modify, and validate software catalog JSON files via Ansible playbook tags.

What this PR adds

  • catalog_generate — Creates a new catalog JSON from a simplified text input file. Fails if the output file already exists unless force=true is specified.
  • catalog_add — Adds or updates (upserts) packages into an existing catalog from an input text file. Auto-creates groups if they don't exist. If a package already exists, it is updated in place — no duplicates are allowed.
  • catalog_delete — Removes packages listed in an input text file from an existing catalog. Auto-removes groups that become empty and cleans up unreferenced packages from the catalog.
  • catalog_validate — Validates a catalog against a JSON Schema and additional business rules (referential integrity, required fields per package type, no orphans, etc.).

Catalog structure supported

The operations target the existing catalog format comprising functionallayer, groups, and packages with support for all four package types: rpm, rpm_repo, tarball, and image [1].

Invocation

All operations are file-driven and invoked via --tags on repo_manager.yml:

ansible-playbook repo_manager.yml --tags catalog_generate -e "input_file=input/packages.txt"
ansible-playbook repo_manager.yml --tags catalog_add     -e "input_file=input/additions.txt"
ansible-playbook repo_manager.yml --tags catalog_delete  -e "input_file=input/removals.txt"
ansible-playbook repo_manager.yml --tags catalog_validate

Optional -e overrides: catalog_file, output_file, force, catalog_name.

Changes

Area What changed
roles/catalog/ New role with tagged tasks for all four catalog operations
plugins/module_utils/catalog/ Python backend — parser, catalog I/O, mutator (upsert/delete), validator
schemas/catalog_schema.json JSON Schema for catalog validation
playbooks/repo_manager.yml Includes the new catalog role
docs/catalog_operations.md Usage guide and input file format reference

Input file format

A minimal text format with optional [defaults] header to avoid repetition of arch, os, and os_version across package lines. Group metadata (type, description) is specified inline on the group header.

Key behaviours

  • Upsert on add — existing packages are modified, not duplicated
  • Cascading cleanup on delete — empty groups are auto-removed; unreferenced packages are purged
  • Separate input/output paths — optionally read from one catalog and write to another to preserve the source

Implement catalog operations (generate, add, delete, validate) with:
- Python backend: parser, I/O, mutator, validator, CLI dispatcher
- Ansible role with operation-specific tasks
- JSON schema for validation
- INI-like input format with [defaults] section
- Upsert semantics and automatic orphan cleanup
- Multi-layer validation and logging
- Comprehensive documentation

Signed-off-by: venu <236371043+Venu-p1@users.noreply.github.com>
…H integration

- Add functional layer parsing to catalog parser
- Support type=functional_layer sections in input files
- Implement functional layer validation rules:
  * Catalog must have at least one functional layer
  * Each functional layer must have components
  * Each functional layer must have exactly one base_os group
  * All group references must exist
- Update catalog_io to store functional layers in catalog JSON
- Enhance mutator to merge functional layers on add/delete operations
- Integrate CATALOG_FILE_PATH environment variable:
  * Prioritize CATALOG_FILE_PATH as default for all catalog operations
  * Support command-line overrides (-i, -o, -c flags)
  * Update role defaults and tasks to use CATALOG_FILE_PATH
- All validation tests pass successfully

Generated with Devin

Signed-off-by: venu <236371043+Venu-p1@users.noreply.github.com>
Signed-off-by: venu <236371043+Venu-p1@users.noreply.github.com>
@Venu-p1
Venu-p1 requested a review from snarthan August 28, 2026 07:25
- Change 'repo_manager' tag to 'repomanager' (no underscores allowed)
- Complies with ansible-lint meta-no-tags rule
- Tags must contain lowercase letters and digits only

Signed-off-by: venu <236371043+Venu-p1@users.noreply.github.com>
@Venu-p1
Venu-p1 marked this pull request as ready for review August 28, 2026 07:32
@Venu-p1
Venu-p1 merged commit 0843cc3 into dell:issue-4849-omnia-modernization Aug 28, 2026
14 checks passed
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.

3 participants