# How do I get a list of diffs when looping around the template module?

**URL:** <https://forum.ansible.com/t/how-do-i-get-a-list-of-diffs-when-looping-around-the-template-module/6058>\
**Category:** Get Help\
**Tags:** dev, module, template, plugin, ansible\
**Created:** [May 29, 2024, 12:36pm UTC](https://forum.ansible.com/t/how-do-i-get-a-list-of-diffs-when-looping-around-the-template-module/6058 "2024-05-29T12:36:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sasa993](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sasa993/32/3601_2.png) [@Sasa993](https://forum.ansible.com/u/Sasa993)\
**Post date:** [May 29, 2024, 12:36pm UTC](https://forum.ansible.com/t/how-do-i-get-a-list-of-diffs-when-looping-around-the-template-module/6058/1 "2024-05-29T12:36:57Z")

</div>

Hi guys,

I am working on an action plugin that is mostly a wrapper around a `template` module. It loops through a list of users and executes the template module for each user and their destination files. Everything works as expected except when `diff mode` is enabled. It only shows diffs for the last user in the list, so my question is: is there a way to get a list of diffs for all users and files that have been affected?  
Here is how I execute the template module:

```py
module_result = self._shared_loader_obj.action_loader.get(
    'template',
    task=new_task,
    connection=self._connection,
    play_context=self._play_context,
    loader=self._loader,
    templar=self._templar,
    shared_loader_obj=self._shared_loader_obj
)

```

Thanks,  
Sasa
