On Thu, 1 Jul 2021 at 06:27, Arun Kumar <[email protected]> wrote:
>
> I fixed it. Need to parse the items as int. so modified it to
> - debug: msg="{{(op.files|sort(attribute="mtime"))[item|int].path}}"
> with_sequence: start=0 end="{{op.files|length-1}}"
Be that as it may, I don't see the need to fiddle with indexes, type
casting and length logic.
Just iterating over the list will give the same result:
- debug: msg="{{ item.path }}"
loop: "{{ op.files|sort(attribute='mtime') }}"
--
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/CAL8fbwMNZEH0N6fGGNfeRPJ4Fs4NrVt5ym31L66_Kou3dj1mHQ%40mail.gmail.com.