fora.loader
Provides the dynamic module loading utilities.
Attributes
attr loader.script_stack
loader.script_stack
A stack of all currently executed scripts ((name, file), frame).
class loader.ImmediateInventory
loader.ImmediateInventory
A temporary inventory just for a single run, without the ability to load host or group module files.
def ImmediateInventory.base_dir()
ImmediateInventory.base_dir()
An immediate inventory has no base directory.
def ImmediateInventory.group_module_file()
ImmediateInventory.group_module_file()
An immediate inventory has no group modules.
def ImmediateInventory.host_module_file()
ImmediateInventory.host_module_file()
An immediate inventory has no host modules.
def ImmediateInventory.available_groups()
ImmediateInventory.available_groups()
An immediate inventory has no groups.
Functions
def loader.load_inventory()
loader.load_inventory()
Loads the global inventory from the given filename or single-host url and validates the definintions.
Parameters
inventory_file_or_host_url: Either a single host url or an inventory module file (
*.py
). If a single host url is given without a connection schema (likessh://
), ssh will be used.
Raises
FatalError: The loaded inventory was invalid.
def loader.run_script()
loader.run_script()
Loads and implicitly runs the given script by creating a new instance.
Parameters
script: The path to the script that should be instanciated
frame: The FrameInfo object as given by inspect.getouterframes(inspect.currentframe())[?] where the script call originates from. Used to keep track of the script invocation stack, which helps with debugging (e.g. cyclic script calls).
name: A printable name for the script. Defaults to the script path.
Last updated