ansible 剧本语法错误

ansible playbook syntax error

Ansible 剧本抛出语法错误,但一切看起来都是正确的。 角色可能有什么问题?

错误:

The error appears to have been in '/home/Desktop/playbooks/xx.yml': line 6, column 7, but may
be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:

roles:
    - role: chronos_task
      ^ here

代码

---
- hosts: localhost
  connection: local
  gather_facts: no
  roles:
    - role: chronos_task
      no_log: true
      chronos_url: 'http://{{ chronos_host }}:{{ chronos_port }}'
      chronos_tasks:
        - type: iso8601

What can be the issue on the role?

问题可能是 chronos_task 角色不在角色路径中。

这就是您在这种情况下收到的确切错误消息。