loop_var value not defined error

Hi All,
I am trying to access the variable using loop, but it’s not working for me.

playbook

Hi Mayank,

loop_var variable has a lifetime for a given task. It won’t be accessible after the task is complete.

Either you can use import_tasks to club all related functionality or use set_fact like

  • set_fact:
    repo: “{{ repos[0] }}”

  • debug: msg=“./{{ item.0 }}/{{ item.1 }}/{{ item.2 }}/{{ item.3 }}”
    with_nested:

  • “{{ repo.os_list }}”

  • “{{ repo.major_distribution_list }}”

  • “{{ repo.name }}”

  • “{{ repo.archs }}”