Skip to content

Add commands to list inventory packages and groups - #452

Open
jakduch wants to merge 2 commits into
theforeman:masterfrom
jakduch:fix/426-427-list-inventory
Open

jakduch wants to merge 2 commits into
theforeman:masterfrom
jakduch:fix/426-427-list-inventory

Conversation

@jakduch

@jakduch jakduch commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Add two discoverable CLI actions backed by Ansible's inventory parser:

  • obal list-packages prints the hosts in the packages group.
  • obal list-groups prints user-defined inventory groups while omitting Ansible's implicit all and ungrouped groups.

Both commands are included in top-level help, produce sorted one-name-per-line output, honor OBAL_INVENTORY, and report the existing missing-inventory error consistently.

Tested against the upstream and Copr manifest fixtures; 79 focused unit and playbook/help tests pass, together with yamllint, Python compilation, and git diff --check.

Fixes #426
Fixes #427

@jakduch

jakduch commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the CI failures: the two discovery playbooks now pass Ansible syntax checks, and the help fixtures use the Python 3.9 baseline that the existing compatibility normalization expects. The 79 focused inventory and playbook/help tests pass locally, together with both playbook syntax checks, yamllint and Pylint.

@jakduch
jakduch force-pushed the fix/426-427-list-inventory branch from da3d412 to 941d757 Compare September 26, 2026 10:06
@jakduch
jakduch force-pushed the fix/426-427-list-inventory branch from 941d757 to 386bfce Compare September 26, 2026 20:49
@jakduch

jakduch commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest master and resolved the tests/test_unit.py conflict by keeping both the new rpmspec-query coverage from the base branch and the inventory-listing tests from this PR. The focused inventory and playbook/help suite still passes locally (79 tests). New head: 386bfce.

@jakduch

jakduch commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

The rebase is clean now, and the full CI run passed: https://github.com/theforeman/obal/actions/runs/36270848155

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.

Add command to list available package groups from package_manifest.yaml Add command to list available packages from package_manifest.yaml

1 participant