First, in your j2, you can't ever reference `item` without `item.key` or 
`item.value`.

However, I think your amin problem is that your first iteration is a dict 
(not a list) and the second is a list of dicts without deterministic keys.

Try this:

hubot_bots:
  testbot:
    owner: 'Bot Wrangler <[email protected]>'
    name: Hubot
    descr: Delightfully aware robutt
    adapter: rocketchat
    environment:
      - key: rocketchat_room
        value: GENERAL
      - key: rocketchat_user
        value: Hubot
      - key: rocketchat_password
        value: Hubot




or:

hubot_bots:
  testbot:
    owner: 'Bot Wrangler <[email protected]>'
    name: Hubot
    descr: Delightfully aware robutt
    adapter: rocketchat
    environment:
      rocketchat_room: GENERAL
      rocketchat_user: Hubot
      rocketchat_password: Hubot


You could also go with with_items and change the vars to:

hubot_bots:
  - label: testbot
    owner: 'Bot Wrangler <[email protected]>'
    name: Hubot
    descr: Delightfully aware robutt
    adapter: rocketchat
    environment:
      rocketchat_room: GENERAL
      rocketchat_user: Hubot
      rocketchat_password: Hubot




-- 
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/f12b734c-6132-4dbe-9a1e-ce776a986cd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to