Had a quick look at the source code for the map filter, and I believe
it will descend to lower levels and the result is an arbitrary list,
so I think this would work.

However, this is of no use if your control node is running a stable OS :-)

The only other approach I can think of is to split out keys from the
'servers' the data structure.  Yes ugly :-(

K

Kahlil (Kal) Hodgson                       GPG: C9A02289
Head of Technology                         (m) +61 (0) 4 2573 0382
DealMax Pty Ltd                            (w) +61 (0) 3 9008 5281

Suite 1415
401 Docklands Drive
Docklands VIC 3008 Australia

"All parts should go together without forcing.  You must remember that
the parts you are reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason.  By all
means, do not use a hammer."  -- IBM maintenance manual, 1925



On Wed, Jan 29, 2014 at 9:35 AM, Nick <[email protected]> wrote:
> On 28/01/14 21:56, Kahlil Hodgson wrote:
>> If your control node has Jinja2.7 you may be able to use the 'map'
>> filter to emulate the desired comprehension
>> See http://jinja.pocoo.org/docs/templates/#builtin-filters
>
> Thanks, I did spot that in the documentation, but sadly, no I don't have the
> right version of jinja2 (on Ubuntu 12.04).  I could try and upgrade, but I
> suspect that wouldn't be sensible.
>
> Besides:
>
>  a) jinja2's map filter looks like it may only handle top-level attributes of
> list items
>  b) the result would be a string and presumably would not be treated as a data
> structure by the consuming role
>
> I'd be pleased to find out I'm wrong, of course.
>
>
>
> N
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to