Escaping colon

  • 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?

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