On Thu, 30 Jan 2020 06:11:34 -0800 (PST) Rakesh Parida <[email protected]> wrote:
> Actually this is not what i want , i just want my item1 to not to iterate
> over the loop and compare every item, it should only compare the relative
> item2.
> PLs check my o/p.
> I just only want the o/p:
> "msg": " dp-steps-common-3.0.12 is not equal to
> dp-steps-common-3.0.15-1911280809_d103a.noarch"
OK. Is this probably what you're looking for?
- debug:
msg: "{{ item.0 }} is not equal to {{ item.1 }}"
loop: "{{ list1|zip(list2)|list }}"
when: item.0.split('-')[-1] is not version(item.1.split('-')[-2])
gives
"msg": "dp-steps-common-3.0.12 is not equal to
dp-steps-common-3.0.15-1911280809_d103a.noarch"
The order and the format of the items is significant. HTH,
-vlado
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200130161717.7afcb336%40gmail.com.
pgp2QB90XsVdD.pgp
Description: OpenPGP digital signature
