Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 3.91 KB

File metadata and controls

40 lines (24 loc) · 3.91 KB
graph LR
    AnsibleBaseRunner["AnsibleBaseRunner"]
    Shell_Utility["Shell Utility"]
    AnsibleBaseRunner -- "relies on" --> Shell_Utility
Loading

CodeBoardingDemoContact

Details

The Ansible Base Runner subsystem is a foundational Python library designed to encapsulate the common logic required for executing various Ansible commands within a StackStorm environment. It promotes code reusability and consistency across different Ansible-related actions.

AnsibleBaseRunner

This is the core abstract base class of the Ansible Base Runner subsystem. It provides the foundational logic for executing various Ansible commands. Its responsibilities include: Input Parameter Parsing: Specifically handles the transformation of --extra_vars arguments (_parse_extra_vars). Environment Management: Ensures correct Ansible execution by prepending the virtual environment path to the system's PATH (_prepend_venv_path). Command Construction: Dynamically builds the full command-line arguments for Ansible binaries (via the cmd property). Binary Resolution: Locates the correct Ansible binary within the environment (via the binary property). External Command Invocation: Executes the constructed command using subprocess.call and handles exit codes (via the execute method). It acts as an Adapter and Facade for Ansible's command-line interface, abstracting the underlying shell execution details for all specific Ansible actions that inherit from it.

Related Classes/Methods:

Shell Utility

This component provides utility functions specifically designed for processing and manipulating shell command arguments. Its primary role is to assist the AnsibleBaseRunner by applying specific replacement rules to command arguments before they are executed, ensuring proper formatting and handling of shell-specific nuances.

Related Classes/Methods: