# Where is the doc/spec for the \`task\` object that gets provided to \`CallbackModule#v2\_playbook\_on\_task\`\_start in callback plugins?

**URL:** <https://forum.ansible.com/t/where-is-the-doc-spec-for-the-task-object-that-gets-provided-to-callbackmodule-v2-playbook-on-task-start-in-callback-plugins/25129>\
**Category:** Ansible Project\
**Created:** [July 29, 2017, 7:26pm UTC](https://forum.ansible.com/t/where-is-the-doc-spec-for-the-task-object-that-gets-provided-to-callbackmodule-v2-playbook-on-task-start-in-callback-plugins/25129 "2017-07-29T19:26:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil1](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@neil1](https://forum.ansible.com/u/neil1)\
**Post date:** [July 29, 2017, 7:26pm UTC](https://forum.ansible.com/t/where-is-the-doc-spec-for-the-task-object-that-gets-provided-to-callbackmodule-v2-playbook-on-task-start-in-callback-plugins/25129/1 "2017-07-29T19:26:46Z")

</div>

Developing a callback plugin and need to recognize when a particular task come through. I did some Google’n but didn’t find anything…

I’m guessing it’s an instance of `Task` from [lib/ansible/playbook/task.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/task.py)?

Does Ansible have API docs? From looking at the source there doesn’t seem to be much in there to generate them off…

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [July 31, 2017, 3:13pm UTC](https://forum.ansible.com/t/where-is-the-doc-spec-for-the-task-object-that-gets-provided-to-callbackmodule-v2-playbook-on-task-start-in-callback-plugins/25129/2 "2017-07-31T15:13:46Z")

</div>

There are some docs on developing callback plugins, but not a lot, and nothing that dives into  
the API: [http://docs.ansible.com/ansible/latest/dev\_guide/developing\_plugins.html#callback-plugins](http://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#callback-plugins)

The callback API is a little bit fuzzy. The callback names and method signatures are pretty stable, but the internals of the objects

passed in (like the Task) aren’t really documented and don’t really guarantee API stability.

For v2\_on\_task\_start ([https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/ **init**.py#L339](https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/ __init__.py#L339)) the ‘task’ arg there is an instance of

an ansible.playbook.task.Task ([https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/task.py#L49](https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/task.py#L49))

---

<div class="post-metadata">

**Author:** ![neil1](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@neil1](https://forum.ansible.com/u/neil1)\
**Post date:** [July 31, 2017, 5:10pm UTC](https://forum.ansible.com/t/where-is-the-doc-spec-for-the-task-object-that-gets-provided-to-callbackmodule-v2-playbook-on-task-start-in-callback-plugins/25129/3 "2017-07-31T17:10:12Z")

</div>

Yup, I found / figured out all those guys. Thanks anyways though.

Yeah… so… callback names and method signatures are pretty stable, just not the arguments they’re called with.

What’s in a Task? I don’t know. You don’t know. Hell, maybe no one knows.

[![](https://lh3.googleusercontent.com/-FUz705Ry9Q8/WX9jd-m81UI/AAAAAAAAABo/aMrgO1AUQCwTDIve1Ve7qdBNMIeFBs8lACLcBGAs/s320/1tcv30.jpg)](https://lh3.googleusercontent.com/-FUz705Ry9Q8/WX9jd-m81UI/AAAAAAAAABo/aMrgO1AUQCwTDIve1Ve7qdBNMIeFBs8lACLcBGAs/s1600/1tcv30.jpg)
