I do have a role foo
defined this way:
# roles/foo/tasks/main.yml
---
- name: restart Apache
systemd:
name: apache2
state: restarted
daemon_reload: yes
bute when I start the playbook which requests this role then I get this error:
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/root/roles/foo/tasks/main.yml': line 4, column 12, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: restart Apache
systemd:
^ here
I do not understand what is wrong here because I found such samples in the documentation...
(I left out the other parts which are defined in this role and are working well)