10:49 <User> ERROR! Syntax Error while loading YAML. mapping values are not allowed in this context The error appears to have been in '/etc/ansible/yonghu,yml': line 9, column 12, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: Fetch file from remote host fetch: ^ here
时间: 2023-11-22 15:53:42 浏览: 179
这个错误提示表明你在 `/etc/ansible/yonghu.yml` 文件的第 9 行的第 12 个字符位置上有一个语法错误,因为 YAML 映射值在这个上下文中不被允许。你可以查看该文件并找到该行,检查该行的缩进和格式是否正确。可能是缩进不正确或者缺少冒号等引起的。确保在 `fetch` 关键字下面的所有内容都正确缩进且正确格式化,如下所示:
```
- name: Fetch file from remote host
fetch:
src: /path/to/remote/file
dest: /path/to/local/directory
```
如果还有问题,你可以在这里贴出你的 `yonghu.yml` 文件以便更好地协助你解决问题。
阅读全文