tools.keys() would give you all of the keys. However in Python/jinja2 this can be shortcut by just specifying tools such as:
when: item not in tools On Thursday, May 7, 2015, Rishi <[email protected]> wrote: > Trying to figure out if the following is possible. > > I have a hash map e.g. > > tools: > a: > foobar: 1 > b: > barfoo: 3 > > - file: path=/some/dir/{{ item }} state=absent > with_items: contents.stdout_lines > when: item not in [[ list of tools keys ]] > > I want [[ list of tools keys ]] to turn into [a,b] basically so the when > clause could work. Any way to do this? > > > -- > 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] > <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/d578b3b2-433d-400e-9dfc-c5400c310e0c%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/d578b3b2-433d-400e-9dfc-c5400c310e0c%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-nGq1Z%3DdQfW5846FrgNH2_phwFAhSZBSRFS-coX3TLWA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
