title: YAML Syntax error (Ansible 2.2.1.0)
body: <p>I'm self-learning Ansible with YAML. I wrote a small test to test the hostname in my environment.</p>
  
  <pre><code>   ---
       - hosts: all
         tasks:
           - name: get server hostname
             command: hostname
  </code></pre>
  
  <p>but when I ran <code>ansible-playbook playbooks/hostname.yml</code> it gave me the error below:</p>
  
  <pre><code>ERROR! Syntax Error while loading YAML.
  
  
  The error appears to have been in '/home/ansible/work/ansible/playbooks/hostname.yml': line 5, column 1, but may be elsewhere in the file depending on the exact syntax problem.
  
  The offending line appears to be:
  
        - name: get server hostname
          command: hostname 
  ^ here
  </code></pre>
  
  <p>I've double checked there is no extra new line. Also, when I remove </p>
  
  <pre><code>name: get server hostname
  </code></pre>
  
  <p>It works perfectly fine for me. Could anyone point it out what might cause this issue?</p>