<p dir="auto">I don't know whether ansible is not YAML standard compliant, but a valid yaml configuration like:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
---
- name: ensure timezone is set in apache2 php.ini
  lineinfile: dest=/etc/php5/apache2/php.ini
              regexp='date.timezone ='
              line='date.timezone = {{ server.timezone }}'"><pre class="notranslate">---
- <span class="pl-ent">name</span>: <span class="pl-s">ensure timezone is set in apache2 php.ini</span>
  <span class="pl-ent">lineinfile</span>: <span class="pl-s">dest=/etc/php5/apache2/php.ini</span>
              <span class="pl-s">regexp='date.timezone ='</span>
              <span class="pl-s">line='date.timezone = {{ server.timezone }}'</span></pre></div>
<p dir="auto">is not accepted as valid. This makes <a href="http://insight.sensiolabs.com" rel="nofollow">http://insight.sensiolabs.com</a> complains and declaring many critical violations.</p>
<p dir="auto">I tested this with <a href="http://www.yamllint.com" rel="nofollow">www.yamllint.com</a> and there are no issues.</p>
<p dir="auto">The <a href="http://yaml.org/spec/current.html#id2503731" rel="nofollow">YAML specification has the following example</a> for a multi line message in double quotes:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="quoted: &quot;So does this
  quoted scalar.\n&quot;"><pre class="notranslate"><span class="pl-ent">quoted</span>: <span class="pl-s"><span class="pl-pds">"</span>So does this</span>
<span class="pl-s">  quoted scalar.<span class="pl-cce">\n</span><span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Write that in a MultilineDoubleQuotedMessage.yml and try to Yaml::parse('MultilineDoubleQuotedMessage.yml') - Symfony will throw an exception like this:</p>
<blockquote>
<p dir="auto">Malformed inline YAML string ("So does this) in .../MultilineDoubleQuotedMessage.yml at line 1 (near "quoted: "So does this").</p>
<p dir="auto">in .../symfony/symfony/src/Symfony/Component/Yaml/Inline.php at line 244<br>
...</p>
</blockquote>
<p dir="auto">I tried that in Symfony 2.2.0 and 2.4.6, but the underlying issue seems to be the reg exp in <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Yaml/Inline.php#L246">https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Yaml/Inline.php#L246</a> , which lives on in Symfony 2.5.0.</p>
<p dir="auto">A unit test in Symfony\Component\Yaml\Tests\YamlTest could look something like this:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public function testParseAcceptsMultilineDoubleQuotedMessage()
{
    $filename = __DIR__ . '/Fixtures/MultilineDoubleQuotedMessage.yml';
    $this-&gt;setExpectedException(null);
    Yaml::parse($filename);
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">testParseAcceptsMultilineDoubleQuotedMessage</span>()
{
    <span class="pl-s1"><span class="pl-c1">$</span>filename</span> = __DIR__ . <span class="pl-s">'/Fixtures/MultilineDoubleQuotedMessage.yml'</span>;
    <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>-&gt;<span class="pl-en">setExpectedException</span>(<span class="pl-c1">null</span>);
    <span class="pl-v">Yaml</span>::<span class="pl-en">parse</span>(<span class="pl-s1"><span class="pl-c1">$</span>filename</span>);
}</pre></div>