title: AnsibleError: template error while templating string: expected token 'end of statement block', got '{'
body: <p>Getting AnsibleError: template error while templating string: expected token 'end of statement block', got '{'</p>
  
  <p>Here is my jinja2 template, can someone help me figure out what is wrong? </p>
  
  <pre><code>no service pad
  service tcp-keepalives-in
  service tcp-keepalives-out
  service timestamps debug datetime msec localtime show-timezone
  service timestamps log datetime msec localtime show-timezone
  service password-encryption
  !
  hostname {{item.hostname}}
  !
  boot-start-marker
  boot-end-marker
  !
  logging buffered 32000
  no logging console
  !
  !
  {% for int in int_details_{{item.hostname}} %}
  interface {{int.int}}
   ip address {{int.ip}} {{int.mask}}
   no shutdown
   !
  !
  {% endfor %}
  !
  {% if (item.OSPF == 'Yes') and (item.hostname == 'R1') %}
  router ospf {{item.OSPF_id}}
   network 0.0.0.0 0.0.0.0 area {{item.OSPF_area}}
  {% elif (item.OSPF == 'Yes') and (item.hostname == 'R2') %}
  router ospf {{item.OSPF_id}}
   network 0.0.0.0 0.0.0.0 area {{item.OSPF_area}}
  {% elif (item.OSPF == 'Yes') and (item.hostname == 'R3') %}
  router ospf {{item.OSPF_id}}
   network 0.0.0.0 0.0.0.0 area {{item.OSPF_area}}
  {% endif %}
  end
  </code></pre>