<h5 dir="auto">Issue Type:</h5>
<p dir="auto">I'm getting "ERROR: Syntax Error while loading YAML script," when a tasks/main.yml file in my role doesn't start with '---', this is optional in YAML and works in previous versions.</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.6 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/5f3ea7512f493c4cd74e683c8a31481a5de51ced/hovercard" href="https://github.com/ansible/ansible/commit/5f3ea7512f493c4cd74e683c8a31481a5de51ced"><tt>5f3ea75</tt></a>)</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Ubuntu 12, 13 and Gentoo</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Over eager syntax checking</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">create a role with a tasks/main.yml w/o starting with ---</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">file works w/o error</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">"ERROR: Syntax Error while loading YAML script,"</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
<li>Documentation Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">apt module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.3.0
  config file = /home/heartsucker/code/freedomofpress/securedrop/ansible.cfg
  configured module search path = Default w/o overrides
"><pre class="notranslate"><code class="notranslate">ansible 2.2.3.0
  config file = /home/heartsucker/code/freedomofpress/securedrop/ansible.cfg
  configured module search path = Default w/o overrides

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">n/a</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">n/a</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">In the <a href="https://docs.ansible.com/ansible/latest/apt_module.html" rel="nofollow">online ansible documentation</a>, the section for <code class="notranslate">force</code> says only this</p>
<blockquote>
<p dir="auto">If yes, force installs/removes.</p>
</blockquote>
<p dir="auto">By looking at the code, it passes <code class="notranslate">--force-yes</code> to <code class="notranslate">apt-get</code></p>
<p dir="auto">From <code class="notranslate">man apt-get</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--force-yes
   Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should
   not be used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes.
   This is deprecated and replaced by --allow-downgrades, --allow-remove-essential, --allow-change-held-packages in 1.1."><pre class="notranslate"><code class="notranslate">--force-yes
   Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should
   not be used except in very special situations. Using force-yes can potentially destroy your system! Configuration Item: APT::Get::force-yes.
   This is deprecated and replaced by --allow-downgrades, --allow-remove-essential, --allow-change-held-packages in 1.1.
</code></pre></div>
<p dir="auto">This is two things: deprecated and extremely dangerous.</p>
<p dir="auto">Also, the key phrase here:</p>
<blockquote>
<p dir="auto">It should not be used except in very special situations. Using force-yes can potentially destroy your system!</p>
</blockquote>
<p dir="auto">At the very least, the ansible docs should also use the phrase "Using force-yes can potentially destroy your system."</p>
<p dir="auto">Additionally, it is the direct cause of this security breach: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="268119059" data-permission-text="Title is private" data-url="https://github.com/freedomofpress/securedrop/issues/2472" data-hovercard-type="issue" data-hovercard-url="/freedomofpress/securedrop/issues/2472/hovercard" href="https://github.com/freedomofpress/securedrop/issues/2472">freedomofpress/securedrop#2472</a></p>
<p dir="auto">The code in question has been reviewed multiple times by highly qualified pentesters and was not revealed in their audits. It has been present in the code since 2015. This means it is very, very likely many people are also making this dangerous mistake.</p>
<p dir="auto">In fact, <a href="https://github.com/search?l=YAML&amp;q=%22force%3A+yes%22+apt&amp;type=Code&amp;utf8=%E2%9C%93">github search agrees</a>.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3998464/31958779-1a59b5f0-b8f3-11e7-8374-037ba0ff7434.png"><img src="https://user-images.githubusercontent.com/3998464/31958779-1a59b5f0-b8f3-11e7-8374-037ba0ff7434.png" alt="screenshot_2017-10-24_19-39-00" style="max-width: 100%;"></a></p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">If a flag/arg/module can do something harmful to the system (like install unauthenticated packages), then it should be made clear in the documentation.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">The documentation did not state the dangers of using <code class="notranslate">force: yes</code></p>