Get output from ansible.playbook.PlayBook()

41 views
Skip to first unread message

Romey-Rome

unread,
Dec 5, 2014, 12:16:27 PM12/5/14
to ansible...@googlegroups.com
I'm executing a playbook from a Flask web service. All output goes to stdout console. I need it in my webapp so that I can send it back to the browser. Best I can get on the server is the summary stats counter from the pb object. (success,skipped,failed,etc)

How can I get the complete output like with ansible.Runner()?

        stats = callbacks.AggregateStats()
        playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
        runner_cb = callbacks.PlaybookRunnerCallbacks(stats,verbose=utils.VERBOSITY)
        
        pb = ansible.playbook.PlayBook(
             playbook = playbook
             stats=stats,
             inventory=targets,
             callbacks=playbook_cb,
             runner_callbacks=runner_cb
        ).run()

Thanks!

Matt Martz

unread,
Dec 8, 2014, 12:30:52 PM12/8/14
to ansibl...@googlegroups.com, roman.ga...@gmail.com
Moving this to ansible-devel.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2eae5651-aa35-4f9a-9ada-5dd96106753f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages