title: How can I escape double curly braces in jinja2?
body: <p>I need to escape double curly braces in a code I'm working on using Ansible.
  The thing is I have all those parameters that needs to be transformed in variables. Basically I'm working on a template creator.</p>
  
  <p>I've tried using {% raw %}{{ name-of-variable }}{% endraw %} but it did not worked. When I tried /{/{ name-of-variable }} I almost got it, but I am trying to get rid of the backslashes too.</p>
  
  <p>Here's a bit of the code:</p>
  
  <pre><code>local_action:
      module: replace
      path: "/tmp/{{ ambiance }}/{{ seed }}DEFAULT.j2"
      regexp: "{{ item.regexp1 }}"
      replace: "{{ item.replace }}"
    with_items: 
      - { regexp1: '^DBHOST.*$', replace: 'DBHOST = {% raw %}{{ databasehost }}{% endraw %}' }
      - { regexp1: '^GLOBALHOST.*$', replace: 'GLOBALHOST = {% raw %}{{ global_hostname }}{% endraw %}' }
  </code></pre>
  
  <p>I expect the result as it follows:</p>
  
  <pre><code>DBHOST = {{ satabasehost }}
  GLOBALHOST = {{ global_hostname }}
  </code></pre>
  
  <p>Any suggestions/ideas?</p>