debugging tip(s) requested (for lineinfile)

160 views
Skip to first unread message

Gallagher Polyn

unread,
May 6, 2014, 12:29:44 PM5/6/14
to ansible...@googlegroups.com
Hi,

I'm attempting to boot and deploy with GCE all in one play (using Sharif Salah's deck and demo repo 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

Michael DeHaan

unread,
May 9, 2014, 8:11:49 PM5/9/14
to ansible...@googlegroups.com
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 :)






--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c661af26-debe-456a-b58e-4b1f0fc66524%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages