我遵循了多个教程,但仍然总是遇到相同的错误。
first.yaml
---
- hosts: all
task
- name: download httpd
yum:
- name: httpd
state: latest
当我跑步时> first-yasible-playbook.yaml我明白了:
ERROR! Syntax Error while loading YAML.
mapping values are not allowed in this context
The error appears to be in '/home/ansible/Document/first.yaml': line 5, column 8, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- hosts: all
^ here
谢谢
你好,尝试这个(docs.ansible.com),
- name: install the latest version of Apache
yum:
name: httpd
state: latest
在name: httpd
之前,在提供的示例中没有-
字符。