When I write a playbook, I always think of:

  1. create hosts or inventories
[lb]
198.163.33.10

[db]
198.163.33.20

[app]
198.163.33.31
198.163.33.32
198.163.33.33

  1. Which remote servers am I running against?
---
- hosts: app
  user: root
  sudo: yes
  gather_facts: yes
  1. What are my tasks?
tasks: 
    - name: Define your task name
      yum: name= state=latest 
      with_items:
        - git
        - ntp
        - nginx
        - vim

    - name: Start ntp 
      service: name=ntpd state=started enabled=yes

    - name: Start nginx
      service: name=nginx state=started enabled=yes
      
    - name: Ensure mysql is installed
      yum: name= state=present
      with_items:
        - mysql-server
        - MySQL-python
        - libselinux-python
        - libsemanage-python 

    - name: Start mysql service
      service: name=mysqld state=started enabled=yes

Here is the overview of my playbook:

---
- hosts: web
  user: root
  sudo: yes
  gather_facts: yes

  tasks: 
    - name: Define your task name
      yum: name= state=latest 
      with_items:
        - git
        - ntp
        - nginx
        - vim

    - name: Start ntp 
      service: name=ntpd state=started enabled=yes

    - name: Start nginx
      service: name=nginx state=started enabled=yes
      
    - name: Ensure mysql is installed
      yum: name= state=present
      with_items:
        - mysql-server
        - MySQL-python
        - libselinux-python
        - libsemanage-python 

    - name: Start mysql service
      service: name=mysqld state=started enabled=yes