找不到此 Ansible 剧本的语法问题

Can't find the syntax issue with this Ansible playbook

我正在尝试 运行 Ansible 剧本,但我无法通过文档或查看示例找出我的剧本有什么问题。

--- - hosts: all sudo: yes pre_tasks: ignore_errors: True tasks: command: sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip command: sudo pip install caravel command: fabmanager create-admin --app caravel command: caravel db upgrade command: caravel init command: caravel runserver -p 8088 - copy: src=../zika.db dest=zika.db failed_when: false

我一直在追我的尾巴,我不明白这个错误:

The offending line appears to be:

---

- hosts: all

  ^ here

command 是一个任务,tasks 是一个列表,所以你应该在每个任务前加上破折号。

tasks:
  - command: ....
  - command: ....
  ....