Q: 20
Refer to the exhibit. Interfaces named Loopback0, Loopback1, and Loopback2 must be created and
enabled on a Cisco IOS XE target device in the lab group. Which loop must be added to the end of the
Ansible “create int” task?Options
Discussion
Had something like this in a mock, and it's A. with_items iterates through the interface list variable in Ansible playbooks, so matches the intent here. The others aren’t valid loop keywords for this use. Anyone disagree?
A tbh. Only with_items handles a list like intlist in Ansible, that's the classic syntax. C (with_list) looks tempting but isn't actually valid in standard playbooks from what I've seen, it's kind of a trap answer. Could be wrong if Ansible changed something recently though, anyone seen otherwise?
A is the Ansible loop syntax for lists, like intlist. Official guide and lab practice both show with_items for iterating interfaces. Pretty sure that's the intent, but happy to discuss if anyone thinks C fits better.
Its C. I remember seeing with_list used before in some playbooks for iterating. Maybe with_items is more common but I think with_list should work here. Not positive though if Ansible syntax changed.
C or D? I get why some think C, but only A (with_items) is actually a valid Ansible loop method for iterating over interface lists. Others just don't work syntactically. Seen it in Ansible docs too. Open to pushback though.
C or D, not totally sure which loop filter works here.
Be respectful. No spam.