# implement checks on every iteration using with\_items

**URL:** <https://forum.ansible.com/t/implement-checks-on-every-iteration-using-with-items/35553>\
**Category:** Ansible Developer\
**Created:** [July 28, 2021, 4:51am UTC](https://forum.ansible.com/t/implement-checks-on-every-iteration-using-with-items/35553 "2021-07-28T04:51:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Som\_Das](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Som\_Das](https://forum.ansible.com/u/Som_Das)\
**Post date:** [July 28, 2021, 4:51am UTC](https://forum.ansible.com/t/implement-checks-on-every-iteration-using-with-items/35553/1 "2021-07-28T04:51:10Z")

</div>

Hi All,

I have the following code:

- name: execute all commands in the file  
cisco.asa.aa\_command:  
commands:
- “{{ item }}”  
with\_lines: cat ./role1/files/commands.txt  
register: output

Now I want to implement a check on every iteration, to check if a command is failed or not
