[WARNING]: While constructing a mapping from /etc/ansible/playbooks/touch.yml, line 2, column 3, found a duplicate dict key (tasks). Using last defined value only.

I have the following playbook and I got the above error. This created the directory but not the file. Any ideas?

When I comment out the directory piece and run it again, ansible will create the file

You can only have one tasks: in a play.
And as the message say only the last one will be executed.

So this is the correct syntax.

Only one task for each playbook? Didnt know that

Ok, nevermind. Only one instance of the tasks:, but multiple tasks underneath. Thanks!