运行剧本出错:
ERROR! Syntax Error while loading YAML.
did not find expected '-' indicator
The error appears to have been in '/etc/ansible/nginx_install/roles/nginx/tasks/main.yaml': line 3, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: install nginx package
yum: name={{ item }} state=latest
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
按照提示的意思是,注意空格,也就是缩进,好好调整即可解决