Accessing "Ansible Variables" in custom modules ?

Hi :

Is there anyway to access the setup module variables in a custom
built modules ?
Are there variables passed to the modules.

Thanks,

Easiest thing is to pass them back to the modules using the dollar
sign syntax. In other words, they already bubble up back to the
playbook, so you just pass the things in that you need.

Trivial example:

command echo $ansible_hostname

Modules don't require the setup module to be used (think
/usr/bin/ansible vs /usr/bin/ansible-playbook), so they don't read
from there.