我正在运行 ansible play-book 但出现以下错误 - 使用 ansible 2.7.6、ubuntu 16.04。在剧本中提到
(<unknown>): did not find expected key while parsing a block mapping at line 6 column 3
我试过没有成为-yes,ubuntu,sudo 也遇到同样的问题和 ansible 说:
The offending line appears to be:
- name: build npm
^ here
- hosts: all
vars:
app_dir: /home/ubuntu/app/backend-app-name
tasks:
- name: build npm
command: "chdir={{ app_dir }} {{ item }}"
with_items:
- /usr/bin/npm run build
become: yes
become_user: ubuntu
become_method: sudo
原文由 shufilkhan 发布,翻译遵循 CC BY-SA 4.0 许可协议
缩进是错误的。正确的语法是