Access to variables in vars/ in custom Ansible module

Hello,

I am developing custom ansible module to do something and i will implement this module as one of task in my new role.
The new custom module is written in python 2.7.

I know how to get variables passing to module in playbook, like:

  • name: task 1
    custom_module_name: arg1=‘foo’

And in python code: module.param.get()

And question is, how to get variables stored in vars/main.yml file or group_vars/all file in this (python) custom module?

Regards,
Gerhard

Custom modules do not natively have access to vars. You will need to explicitly pass them into the module