# How can custom module plugin can transmit a variable and callback plugin can capture it?

**URL:** <https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274>\
**Category:** Get Help\
**Tags:** module\
**Created:** [January 11, 2024, 2:11pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274 "2024-01-11T14:11:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AishwaryaPreet07](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aishwaryapreet07/32/1973_2.png) [@AishwaryaPreet07](https://forum.ansible.com/u/AishwaryaPreet07)\
**Post date:** [January 11, 2024, 2:11pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274/1 "2024-01-11T14:11:59Z")

</div>

hi

I am trying to create a custom module which could transmit a variable and callback plugin could use that variable for its execution.

---

<div class="post-metadata">

**Author:** ![kpfleming](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kpfleming](https://forum.ansible.com/u/kpfleming)\
**Post date:** [January 11, 2024, 2:27pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274/2 "2024-01-11T14:27:18Z")

</div>

This is done by having the module include the relevant content in its return value, and then the user capturing that (using `register`) and passing the desired content to the plugin. There is no internal mechanism to do this.

---

<div class="post-metadata">

**Author:** ![AishwaryaPreet07](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aishwaryapreet07/32/1973_2.png) [@AishwaryaPreet07](https://forum.ansible.com/u/AishwaryaPreet07)\
**Post date:** [January 11, 2024, 5:08pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274/3 "2024-01-11T17:08:22Z")

</div>

But how that could be used in custom callback plugin!!

---

<div class="post-metadata">

**Author:** ![kpfleming](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kpfleming](https://forum.ansible.com/u/kpfleming)\
**Post date:** [January 11, 2024, 5:28pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274/4 "2024-01-11T17:28:03Z")

</div>

It may not be possible, since callback plugins don’t accept any parameters.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 11, 2024, 7:42pm UTC](https://forum.ansible.com/t/how-can-custom-module-plugin-can-transmit-a-variable-and-callback-plugin-can-capture-it/3274/5 "2024-01-11T19:42:57Z")

</div>

Can you state what you want to accomplish outside of implementation? there might be easier ways to get the end result you want.
