Where is the doc/spec for the `task` object that gets provided to `CallbackModule#v2_playbook_on_task`_start in callback plugins?

24 views
Skip to first unread message

ne...@neilsouza.com

unread,
Jul 29, 2017, 3:26:46 PM7/29/17
to Ansible Project
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?

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

Adrian Likins

unread,
Jul 31, 2017, 11:14:08 AM7/31/17
to ansible...@googlegroups.com
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

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) 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)



--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/297ecbdf-3b78-4e38-bd1c-209fd7963f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ne...@neilsouza.com

unread,
Jul 31, 2017, 1:10:12 PM7/31/17
to Ansible Project
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.



On Monday, July 31, 2017 at 11:14:08 PM UTC+8, Adrian Likins wrote:
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

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) 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)


On Sat, Jul 29, 2017 at 3:26 PM, <ne...@neilsouza.com> wrote:
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?

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

--
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.
Reply all
Reply to author
Forward
0 new messages