SyntaxFix
Write A Post
Hire A Developer
Questions
Above solution by @toast38coza worked for me; just that sudo: yes is deprecated in Ansible now. Use become and become_user instead.
tasks: - name: Restart apache service service: name=apache2 state=restarted become: yes become_user: root