# method for deleting ip sla config lines at different routers

**URL:** <https://forum.ansible.com/t/method-for-deleting-ip-sla-config-lines-at-different-routers/27047>\
**Category:** Ansible Project\
**Created:** [March 20, 2018, 1:29am UTC](https://forum.ansible.com/t/method-for-deleting-ip-sla-config-lines-at-different-routers/27047 "2018-03-20T01:29:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aegiacometti](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@aegiacometti](https://forum.ansible.com/u/aegiacometti)\
**Post date:** [March 20, 2018, 1:29am UTC](https://forum.ansible.com/t/method-for-deleting-ip-sla-config-lines-at-different-routers/27047/1 "2018-03-20T01:29:32Z")

</div>

Hi guys, i 've been tasked for deletion of “ip sla x” lines at several routers.  
I have created this playbook, that works fine with all routers, except the ones which do not have “ip sla x” configured.  
This is the playbook:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 22, 2018, 8:44pm UTC](https://forum.ansible.com/t/method-for-deleting-ip-sla-config-lines-at-different-routers/27047/2 "2018-03-22T20:44:26Z")

</div>

You should ha provided the content of the variable showcommand  
&nbsp;&nbsp;&nbsp;- debug: var=showcommand

Since I don't use ios\_command and don't have the content this might be completely wrong.

I thing you need to use showcommand.stdout and not showcommand.stdout\_lines.  
When using that with with\_items you will have the content of each of them in the variable item so you need to use item in when:

&nbsp;&nbsp;&nbsp;with\_items: "{{ showcommand.stdout }}"  
&nbsp;&nbsp;&nbsp;when: item != ""
