lso.playbook
Module that gathers common API responses and data models.
- lso.playbook.get_playbook_path(playbook_name)
Get the path of a playbook on the local filesystem.
- lso.playbook.get_thread_pool()
Get and optionally initialise a ThreadPoolExecutor.
- Returns:
ThreadPoolExecutor
- lso.playbook.run_playbook(playbook_path, extra_vars, inventory, callback)
Run an Ansible playbook against a specified inventory.
- Parameters:
playbook_path (Path) – playbook to be executed.
extra_vars (dict[str, Any]) – Any extra vars needed for the playbook to run.
inventory (dict[str, Any] | str) – The inventory that the playbook is executed against.
callback (HttpUrl) – Callback URL where the playbook should send a status update when execution is completed. This is used for workflow-orchestrator to continue with the next step in a workflow.
- Returns:
Result of playbook launch, this could either be successful or unsuccessful.
- Return type:
fastapi.responses.JSONResponse