title: Printing a variable value indented in a YAML file using ansible
body: <p>I'm generating a Behat config file using Ansible. This configuration file is a YAML file. I'm using a Jinja2 template like this:</p>
  
  <pre><code>default:
    paths:
      features: '../all/tests/features'
    filters:
      tags: "~@api&amp;&amp;~@drush"
    extensions:
      Behat\MinkExtension\Extension:
      files_path: '{{ project_docroot }}/sites/all/tests/files'
        files_path: '{{ project_docroot }}'
        goutte: ~
        selenium2: ~
        base_url: '{{ base_url }}'
      Drupal\DrupalExtension\Extension:
        blackbox: ~
        drush_driver: "drush"
        drush:
          root: "{{ project_docroot }}"
        api_driver: "drupal"
        drupal:
          drupal_root: "{{ project_docroot }}"
        region_map:
  {{ project_behat_region_map }}
        selectors:
  {{ project_behat_selectors }}
  </code></pre>
  
  <p>And the following defined vars:</p>
  
  <pre><code>project_behat_region_map: |
          content: "#content"
          footer: "#footer"
          header: "#header"
          header bottom: "#header-bottom"
          navigation: "#navigation"
          highlighted: "#highlighted"
          help: "#help"
          bottom: "#bottom"
  
  project_behat_selectors: |
          message_selector: '.messages'
          error_message_selector: '.messages.error'
          success_message_selector: '.messages.status'
          warning_message_selector: '.messages.warning'
  </code></pre>
  
  <p>As you can see the variable values are indented, but when pasted into the Jinja2 template the lost indentation:</p>
  
  <pre><code>default:
    paths:
      features: '../all/tests/features'
    filters:
      tags: "~@api&amp;&amp;~@drush"
    extensions:
      Behat\MinkExtension\Extension:
      files_path: '/var/www//bacteriemias/docroot/sites/all/tests/files'
        files_path: '/var/www//bacteriemias/docroot'
        goutte: ~
        selenium2: ~
        base_url: 'http://bacteriemias.me'
      Drupal\DrupalExtension\Extension:
        blackbox: ~
        drush_driver: "drush"
        drush:
          root: "/var/www//bacteriemias/docroot"
        api_driver: "drupal"
        drupal:
          drupal_root: "/var/www//bacteriemias/docroot"
        region_map:
  content: "#content"
  footer: "#footer"
  header: "#header"
  header bottom: "#header-bottom"
  navigation: "#navigation"
  highlighted: "#highlighted"
  help: "#help"
  bottom: "#bottom"
  
  
        selectors:
  message_selector: '.messages'
  error_message_selector: '.messages.error'
  success_message_selector: '.messages.status'
  warning_message_selector: '.messages.warning'
  </code></pre>
  
  <p>This is not valid YAML. How can I print a variable with indentation in Jinja2?</p>