Expand description
Ansible-collection import (Tier-1 CLI-veneer detection).
Ansible collections ship as .tar.gz archives per the Galaxy artifact
spec. For a large class of vendor collections, every “module” is a thin
action plugin that just shells out to an external CLI - the YAML is a
friendly veneer over a binary the controller already has on PATH.
For these collections we don’t need the ansible-playbook runtime to
convert their playbooks: we can inspect the action-plugin source at
import time, extract the CLI command string, and emit a corresponding
flow node (zowe-adapter cli-tool when the binary is zowe, shell
run-command otherwise).
This module does the extract-and-detect half:
- Open a collection
.tar.gz, validate (entry count, total size, no path traversal), and read the on-tape entries we care about (MANIFEST.json,plugins/action/*.py). - Run a small regex pass over each action-plugin’s source looking for
the two patterns that cover the realistic Tier-1 surface:
zowe_command = "<cmd>"(zowe-CLI-veneer collections)command_to_run = "<cmd>"(generic CLI veneer)
- Return a
CollectionPreviewthe frontend’s resolver pipeline can seed itself with. Unknown modules surface ascli_command: Noneso the resolver pipeline still falls through to the builtin table / fallback for them.
Structs§
Enums§
Functions§
- import_
collection - Top-level entry point. Reads + validates the tarball, scans every
plugins/modules/*.pyto enumerate the collection’s surface, then runs the CLI detector against each module’s matching action plugin (if any).