Hadron / Hadron/carthage

Add tail_ansible_log

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
11
Forks
8
Avg merge
9h 26m
Merged PRs (30d)
6

Description

It would be nice to be able to tail a log to stdout (or a web page) while some ansible task is running.
I'm imagining carthage.ansible gaining a tail_ansible_log function. You start run_playbook (or a role task) as a future, start up tail_ansible_log, and then when the future for the ansible task completes, you kill off the tail, code something like:
```python
ansible_task = loop.create_task(ainjector(run_playbook, ...))
try:
tail_task = loop.create_task(ainjector(tail_ansible_log, sys.stdout))
return await ansible_task
finally:
tail_task.cancel()
```
cc: @kdienes who will certainly wish that update_aptly already did this. I plan to implement as soon as I have the support in core.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.