Hi Vladimir, Thanks for the reply. Awsome. Its exactly what i want to achieve. Thanks for your time . Highly appreciate your help:)
With Regards Rakesh On Thursday, January 30, 2020 at 11:59:37 PM UTC+5:30, Vladimir Botka wrote: > > On Thu, 30 Jan 2020 10:08:02 -0800 (PST) > Rakesh Parida <[email protected] <javascript:>> wrote: > > > Is there any way the list comparision would be successful even if the > > sequence is altered. > > > > list1: > > - iam-python-common-1.0.0 > > - iam-service-default-3.1.42 > > - dp-steps-common-3.0.12 > > list2: > > - dp-steps-common-3.0.15-1911280809_d103a.noarch > > - iam-service-default-3.1.37-1911141021_63e48.noarch > > - iam-python-common-1.0.1-1910242116.noarch > > Sure. Sort the lists. For example > > - debug: > msg: "{{ item.0 }} is not equal to {{ item.1 }}" > loop: "{{ list1|sort|zip(list2|sort)|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" > "msg": "iam-python-common-1.0.0 is not equal to > iam-python-common-1.0.1-1910242116.noarch" > "msg": "iam-service-default-3.1.42 is not equal to > iam-service-default-3.1.37-1911141021_63e48.noarch" > > 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/ce791118-6f41-44de-a923-f78dca4c2559%40googlegroups.com.
