Generating pretty HTML report from the list-tasks option.

20 views
Skip to first unread message

Stanley Kamithi

unread,
Apr 7, 2016, 12:44:38 PM4/7/16
to Ansible Project
Is there a plugin that exists, or a feature in the works, where I can do something like this

--
ansible-playbook --list-tasks --format html  site.yml
---

If this feature is not there, and someone else is working on it, I would love to help out.

Having this feature will save me time in documenting build scenarios.



J Hawkesworth

unread,
Apr 9, 2016, 3:41:43 PM4/9/16
to Ansible Project
Nice idea.

I haven't seen anything like that.

You might be able to do it by creating a custom callback plugin, although I've not investigated whether --list-task would actually generate any callback events. 

I'd be tempted to do something quick and dirty like this:

echo "<!DOCTYPE html><html lang="en"><head>" > deployment_plan.html
echo "<title>Deployment Plan</title></head><body><pre>" >>  deployment_plan.html
ansible-playbook site.yml --list-tasks >> deployment_plan.html
echo "</pre></body></html>" >> deployment_plan.html

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages