2017-07-07 129 views
0

Ansible playbook抛出语法错误,但一切看起来正确。 什么是角色的问题?ansible playbook语法错误

错误

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 

CODE

--- 
- 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 
+0

备案。几个YAML验证器确定这个块是有效的YAML。 – castis

+0

是的,我甚至尝试在aws环境中执行,我仍然不知道语法错误可能在哪里 – Swat

回答

1

什么可以对角色的问题?

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

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

+1

如果这实际上是问题,那么'ansible-lint'会在这里有所帮助,因为它会抛出错误角色的错误。 –