Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with_items works with lists of dictionaries, doesn't work with lists of lists #4647

Closed
darklajid opened this issue Oct 22, 2013 · 1 comment

Comments

@darklajid
Copy link

Lots of places (including Michael DeHaan's posts, [1]) claim that this works:

  • name: Index into the item
    debug: msg="{{item.0}}"

    Same with item[0]

    with_items:
    • [ 'Foo', 1 ]
    • [ 'Bar', 2 ]

It doesn't in 1.3.3. {{item}} is always the first thing in the list, {{item.0}} ends up as being the first char (in this case) of the first colum: 'F', 'B'.

Note that the dictionary version still works:

  • name: Index into the item
    debug: msg="{{item.key}}"
    with_items:
    • { key: 'Foo', value: 1 }
    • { key: 'Bar', value: 2 }

I guess that's a regression?

1: https://coderwall.com/p/uaeeug

@mpdehaan
Copy link
Contributor

This is not a regression but in fact a feature, because if you supply two lists of packages it will install them all in one and has been the case for some time.

Stop by the list if you have questions (you could also write your own lookup plugin if you wanted different behavior).

@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants