Ansible playbook errors: multiple tasks in a single playbook

I am a noob at ansible, and I am trying to learn it to automate log collection for our lab. My yaml file is right below: Executing this gives me an error near the second set of tasks. I am searching everyhwere but what am actually confused about is this:. Is this allowed ? As far as I have read, hosts: x tasks: A hosts:y tasks:B should be allowed. Then why am i seeing this error?
Thanks,
Surya

It helps to include the error you are asking about.