title: Using hyphen in ansible
body: <p>I am learning Ansible but I am getting confused when to use hyphen and when not to use hyphen in playbook. As I know, hyphen is used for list in Ansible.</p>
  
  <p>For example,</p>
  
  <pre><code>--- # my first playbook
        - hosts: webservers  ( why did we use hyphen here it is not a list)
          tasks: 
            - name: installing httpd
              yum: name=httpd state=installed ( why we shouldn't use hyphen here).
  </code></pre>
  
  <p>From Ansible documentation, it is said that hyphen is for list, for example:</p>
  
  <pre><code>fruits:
    - apple
    - grapes
    - orange
  </code></pre>
  
  <p>So, I am confused when to use hyphens and when not to use.</p>