want to pass output of external shell script as variable to ansible task

I have a scenario where i have a shell script running externally which at every execution generates dynamic value(can’t add it as ansible task since it is not being executed on any inventory host), i want to use output of this shell script as variable in my current ansible playbook.

Any help on this will be highly appreciated

How does this mysterious "output" reach you normally (without ansible)?

(replying to the list as you've (hopefully accidentally) sent me a
private message)

You certainly can add it as an Ansible task even though it runs on a host not in your inventory.
Read up on delegate_to.