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.
For example,
--- # 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).
From Ansible documentation, it is said that hyphen is for list, for example:
fruits:
- apple
- grapes
- orange
So, I am confused when to use hyphens and when not to use.