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

On Sun, Feb 14, 2016 at 1:25 PM, Gerhard <[email protected]>
wrote:

> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7b8f640c-e83e-4ad4-9374-9c662ab73b5b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7b8f640c-e83e-4ad4-9374-9c662ab73b5b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v_r0S_nM4MkChAQ0aCg92HMdqu6Ay6yNHe88tUFDV1uUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to