You can access the fact functions by importing the "module_utils" code for
the facts functions and calling them directly from within your module.

This is in fact how the setup module itself is written.

Take a look at what it does and follow suit, and it should be pretty
straightforward.

In the future, this is about developing on Ansible, so probably better
suited for ansible-devel.   I'm trying to get that list to have a bit nicer
momentum :)

Thanks!






On Thu, May 15, 2014 at 6:32 AM, Christian Huck <[email protected]>wrote:

> Hi,
>
> how can I access the ansible_facts within a custom module which was
> initialized with the AnsibleModule class ?
>
> I either:
>
> a) need to pass the facts as a module parameter
>
> or
>
> b) access the facts directly inside the module
>
> Thanks in advance.
>
> Christian
>
> --
> 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/5c9c94bb-6092-460b-9f44-3944306f6703%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/5c9c94bb-6092-460b-9f44-3944306f6703%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgxW-jKnUb15vD_xArkjdZRYKVL4-bhafPif3AcDm2aO%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to