Skip to content

simple progress callback for python API usage #1484

@dmzoneill

Description

@dmzoneill

it'd be useful to have a simple progress indicator when running long playbooks via the python API. right now when you call ansible_runner.run() in a script there's no feedback until it's done — looks like the program hung.

doesn't need to be fancy, just something like a callback option that gets invoked periodically with current task info. could be as simple as:

def progress(event, **kwargs):
    if event == 'task_start':
        print(f"running: {kwargs['task']}")

r = ansible_runner.run(
    private_data_dir='...',
    playbook='site.yml',
    progress_callback=progress
)

the event stream already has this data, just need a way to hook into it without having to implement a full custom callback plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs_triageNew item that needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions