Combining with_items with "when:".

Tried encapsulating it in " "?

when: {{ omgeving }} == “{{ europort.environment }}”

That advice is not it, Lester, as you can see from his above message that the variable didn’t expand.

The problem is that you have defined “europort” as a list of a single item that contains a hash, rather than a normal hash.

Try this:

Ah ok, but how do I manage multiple items then Like they way I have it now:

europort:

  • environment: eptm
    epuser: eepletm
    orasid: EPTM
    changenr: 02940328
    version: “0508”
    patches: “02”

  • environment: ept1
    epuser: eeplet1
    orasid: EPT1
    changenr: 02940328
    version: “0508”
    patches: “02,04”

  • environment: ept2
    epuser: eeplet2
    orasid: EPT2
    changenr: 086940328
    version: “0509”
    patches: “09,10,11”

  • environment: ept4
    epuser: eeplet4
    orasid: EPT89
    changenr: 029sdsd328
    version: “0508”
    patches: “001,01,02”

I think the syntax you are looking for is:

when: omgeving == item.environment
with_items: europort

yes!

THANK YOU!

That was the exact “fix”.