# Escaping colon

**URL:** <https://forum.ansible.com/t/escaping-colon/16505>\
**Category:** Ansible Project\
**Created:** [October 14, 2014, 5:47pm UTC](https://forum.ansible.com/t/escaping-colon/16505 "2014-10-14T17:47:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [October 14, 2014, 5:47pm UTC](https://forum.ansible.com/t/escaping-colon/16505/1 "2014-10-14T17:47:59Z")

</div>

- name: Set iptables to log rejected packets 5  
lineinfile: dest=/etc/rsyslog.conf  
insertafter=“^#kern.\*\ \ \*/dev/console”  
line=“{{item}}”  
with\_items:
- “& ~”
- “:msg,contains,"iptables " /var/log/iptables.log”
- “# iptables logs”
- " "

The line “:msg,contains,"iptables " /var/log/iptables.log” always bombs out. I’ve tried:

“:msg,contains,"iptables " /var/log/iptables.log”

‘:msg,contains,"iptables " /var/log/iptables.log’

“':'msg,contains,"iptables " /var/log/iptables.log”

and I think a couple of other goofy things I found while Googling like enclosing everything after lineinfile: with strong quotes.

What the heck do I need to do to get that line to pass?

---

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [October 14, 2014, 5:52pm UTC](https://forum.ansible.com/t/escaping-colon/16505/2 "2014-10-14T17:52:42Z")

</div>

GAAAAHHHH! N/M, line=‘{{item}}’ is what I needed…
