with_items + with_sequence

Hello guys,

I need to do something like:

`

  • name: test
    debug:
    msg: “{{ item.0 }} → {{ item.1 }}”
    with_together:
  • “{{ ips }}”
  • with_sequence: start={{ cluster_start }} end={{ cluster_end }} format=%02x
    `

Is there a way to do that?

Thanks!

David

Nevermind guys,

Figure it out:

`

  • name: test
    debug:
    msg: “{{ item.0 }} → {{ item.1 }}”
    with_together:
  • “{{ ips }}”
  • “{{ lookup(‘sequence’, ‘start=1 end=2 format=%02x’, wantlist=true) | list }}”
    `

Cheers

David

with_sequence is the lookup plugin sequence so something like this

   - "{{ lookup('sequence', 'start=' ~ cluster_start ~ ' end=' ~ cluster_end ~ ' format=%02x').split(',') }}"