# debugging tip(s) requested (for lineinfile)

**URL:** <https://forum.ansible.com/t/debugging-tip-s-requested-for-lineinfile/15170>\
**Category:** Ansible Project\
**Created:** [May 6, 2014, 4:29pm UTC](https://forum.ansible.com/t/debugging-tip-s-requested-for-lineinfile/15170 "2014-05-06T16:29:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gallagher\_Polyn](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@Gallagher\_Polyn](https://forum.ansible.com/u/Gallagher_Polyn)\
**Post date:** [May 6, 2014, 4:29pm UTC](https://forum.ansible.com/t/debugging-tip-s-requested-for-lineinfile/15170/1 "2014-05-06T16:29:44Z")

</div>

Hi,

I’m attempting to boot and deploy with GCE all in one play (using Sharif Salah’s [deck](https://speakerdeck.com/sharifsalah/google-compute-engine-and-ansible) and [demo repo](https://github.com/sharifsalah/ansible-examples) as my basis.)

I’m succeeding until…

> - name: insert iptables rule
> 
> lineinfile: dest=/etc/sysconfig/iptables state=present regexp=“{{ mysql\_port }}”
> 
> insertafter=“^:OUTPUT " line=”-A INPUT -p tcp --dport {{ mysql\_port }} -j ACCEPT"
> 
> notify: restart iptables

…gives me this:

> failed: [node1] =\> {“failed”: true, “item”: “”, “rc”: 257}  
> msg: Destination /etc/sysconfig/iptables does not exist !

When I log into the instance, /etc/sysconfig/iptables is present.

I suspect there is something amiss in how I am executing the play, but I don’t know what.

What is a good debugging approach, here? (I’m thinking some ad hoc command experiments with the stat module could help, but I’m not succeeding with those.)

Thanks,

G

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 10, 2014, 12:11am UTC](https://forum.ansible.com/t/debugging-tip-s-requested-for-lineinfile/15170/2 "2014-05-10T00:11:49Z")

</div>

You can check out ansible on the remote host and use “./hacking/test-module” to run the module locally, and add some debug.

This may be effective in learning more.

I would of course check to make sure some gremlins weren’t installing iptables later just before you logged in 🙂
