How Do You Troubleshoot “ERROR! ‘service’ is not a valid attribute for a Play”?

Problem scenario
You are trying to use the "service" Ansible playbook reserved word.  You want a service to be started.  But when you run the Ansible playbook, you get "ERROR! 'service' is not a valid attribute for a Play".  How do you fix this?

Solution
Change the formatting of the playbook.  Eliminate spaces and make sure indentation aligns with other sections of the playbook.

Leave a comment

Your email address will not be published.