set_fact is not a valid attribute for a Play

Hi Everyone,

I am a newbie using ansible and trying to write a playbook. I was encountering an issue with using set_fact variable in my play and not sure where i am going wrong . could any one correct me on this error. Thanks for your time

Error:

ERROR! ‘set_fact’ is not a valid attribute for a Play

The offending line appears to be:

Hi,

Can you share the whole of your playbook?

You probably need to specify some hosts that you want the playbook to apply to (something like this - not tested):

Hi J,

thanks for taking time to look into this.I was using kitchen-vagrant to do testing by launching debian in virtualbox. My hosts file,kitchen.yml, including main.yml and debian.yml files that i have so far in my play book are attached below. I am also curios if i can call tasks directly through the playbook or i need to mention their absolute path during the path. when i tried just the name of the task, it failed with the message “Error: not found”.

Kitchen.yml

main.yml (after include) is not a playbook, its a task list, hence the message as it is trying to read the Task as a Play.