I tried 2-3 combination , but nothing worked , So i thought of asking here , Since my issue fix from here only.
Then i found the solution by small research on jinja and dict register output
- name: "Register a Variable and Search to perform Operation"
hosts: localhost
vars:
list_of_sequence: "{{ range(1, 100) | list }}"
tasks:
- name: Create a series of directories with even numbers for some reason
ansible.builtin.file:
path: "/var/test{{ '%02d' | format(item) }}"
state: directory
mode: '0655'
become: true
register: res
when: not (res.changed | d(false))
loop: '{{ list_of_sequence }}'