Hi Anand,

Fun though it may be, I hope we are not getting too off-topic by
discussing new and obscure jinja2 features on the ansible list :-)

I currently don't have things set up to test this, so I'm just making
guesses based on the documentation and eye-balling the code.

My next thought is to see what we are passing to the last link in the
filter chain with

{{ansible_em1.ipv6 | selectattr("scope", "equalto", "link") | first | pprint }}

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 Thu, Jan 2, 2014 at 8:23 PM, Anand Buddhdev <arh...@gmail.com> wrote:
> On Thursday, 2 January 2014 00:48:22 UTC+1, Kahlil Hodgson wrote:
>
> Hi again Kahlil,
>
> I branched my ansible setup, and patched jinja2 with the commit from github
> to add the "equalto" test.
>
>> So I think the following might work:
>>
>> {{  ... | selectattr('scope', 'equalto', 'local') | ... }}
>
>
>   So in my playbook I wrote:
>
> debug: msg='{{ ansible_em1.ipv6 | selectattr("scope", "equalto", "link") |
> first | attr("address") }}'
>
> But now I get the error message:
>
> TASK: [debug msg='{{ansible_em1.ipv6 | selectattr("scope", "equalto",
> "link") | first | attr("address")}}'] ***
>
> fatal: [ns1.ams.authdns.ripe.net] => One or more undefined variables: 'dict
> object' has no attribute 'address'
>
> This is getting weirder!
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to