graph LR
AnsibleBaseRunner["AnsibleBaseRunner"]
Shell_Utility["Shell Utility"]
AnsibleBaseRunner -- "relies on" --> Shell_Utility
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.
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:
ansible_base.AnsibleBaseRunner(14:141)ansible_base.AnsibleBaseRunner:_parse_extra_vars(30:85)ansible_base.AnsibleBaseRunner:_prepend_venv_path(88:97)ansible_base.AnsibleBaseRunner:cmd(112:119)ansible_base.AnsibleBaseRunner:binary(122:141)ansible_base.AnsibleBaseRunner:execute(99:108)
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: