# Do I need to use a nested loop for this?

**URL:** <https://forum.ansible.com/t/do-i-need-to-use-a-nested-loop-for-this/35445>\
**Category:** Ansible Project\
**Created:** [June 30, 2021, 6:27pm UTC](https://forum.ansible.com/t/do-i-need-to-use-a-nested-loop-for-this/35445 "2021-06-30T18:27:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clint\_Denham](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Clint\_Denham](https://forum.ansible.com/u/Clint_Denham)\
**Post date:** [June 30, 2021, 6:27pm UTC](https://forum.ansible.com/t/do-i-need-to-use-a-nested-loop-for-this/35445/1 "2021-06-30T18:27:14Z")

</div>

TL;DR - I need to use with\_items on a Task (that is already using a loop) but I can’t use loop and with\_items in the same Task and ‘think’ I need to use a nested loop. I can’t find an idiot’s guide on how to accomplish this so if anyone knows an example of how to accomplish this, I’d really appreciate it.

So I work on F5 equipment and we use their VIPRION acting as a hypervisor for multiple hosted Guest F5s within it.

I’m using a Playbook to upgrade the hypervisors but need to check the Guests contained within these hypervisors before/after the upgrade for general info. The Guests are directly accessible from the Ansible controller so I don’t have to use a jumphost type config.

Scenario
