Django render playbook output to template realtime [closed]
i am struggling to get real time output of my django webapp. in a nutsshell a request from web client triggers an ansible playbook but i am struggling to capture the output of the ansible playbook and render it to the template. any suggestions (minimal config change) is welcome and anticipated.
i have a django web app which takes a request as variable, converts that variable as an inventory source for an ansible play book, for example: cmd = ansible-playbook -i {{variable }} start_a_service.yml os.system(cmd) this command generates an output (below example)
TASK [httpd : Starting the service] ************************************* changed: [ansible-test-vm].
I wish to capture the above output and render it to a template instantly. tried celery / channels but in vain.