Hi Jason,

No way to do what you are asking for today.  You would have to build a
"running fact" in the playbook to achieve this.  I think the better and
more preferred way would be to prepend your facts (nxos_neighbors,
nxos_interfaces, etc).

Peter

On Sun, Dec 20, 2015 at 7:52 AM, Jason Edelman <[email protected]> wrote:

> Hi,
>
> I'm looking to return ansible_facts from multiple modules but have the
> results be updated to be in a common value within ansible_facts.  (just
> like ansible_facts already does)
>
> For example, in module 1, I want to have;
>
>     results = {}
>     results['nxos'] = dict(neighbors=neighbors)
>     module.exit_json(ansible_facts=results)
>
> and module 2, I'd like to have:
>
>     results = {}
>     results['nxos'] = dict(interfaces=interfaces)
>     module.exit_json(ansible_facts=results)
>
> But it seems the second overwrites the first so I'm just left with nxos
> having a single key which is interfaces.  Is it possible to _update_ the
> 'nxos' dictionary in this example and not treat it as a new object?
> Clearly, I can just use ansible_facts, but it would be preferred to keep
> them within the same "key" here.
>
> Or is there another way to accomplish this?
>
> Thanks,
> Jason
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> 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/CAEkdrMigvoTsiuO7B8c5h55imvUivUGXPXhvOm2_CFAvzoaRSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to