# List tasks for a play in a callback plugin

**URL:** <https://forum.ansible.com/t/list-tasks-for-a-play-in-a-callback-plugin/22768>\
**Category:** Ansible Project\
**Created:** [October 11, 2016, 12:51pm UTC](https://forum.ansible.com/t/list-tasks-for-a-play-in-a-callback-plugin/22768 "2016-10-11T12:51:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Matsson](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Daniel\_Matsson](https://forum.ansible.com/u/Daniel_Matsson)\
**Post date:** [October 11, 2016, 12:51pm UTC](https://forum.ansible.com/t/list-tasks-for-a-play-in-a-callback-plugin/22768/1 "2016-10-11T12:51:28Z")

</div>

Hi!

I’m trying to create a callback plugin where I would like to get a list with all tasks that will be running before they are actually executed. I’m able to get a list with all plays using playbook.get\_plays() but if I try to get tasks for each play (play.get\_tasks()) it just returns an empty list. Could it be that all data have not been loaded yet (v2\_playbook\_on\_start()) or am I doing something wrong?

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 17, 2016, 7:05pm UTC](https://forum.ansible.com/t/list-tasks-for-a-play-in-a-callback-plugin/22768/2 "2016-10-17T19:05:34Z")

</div>

That data does not exist yet.
