0
我們必須安裝Apache,複製配置文件,然後啓動並配置它運行。Ansible Playbook - 安裝/配置Apache錯誤
這是迄今爲止寫的劇本:
---
- hosts: example
tasks:
- name:Install Apache
command: yum install --quiet -y httpd httpd-devel
- name:Copy configuration files
command:>
cp httpd.conf /etc/httpd/conf/httpd.conf
- command:>
cp httpd-vshosts.conf /etc/httpd/conf/httpd-vshosts.conf
- name:Start Apache and configure it to run
command: service httpd start
- command: chkconfig httpd on
然而,當我運行命令:ansible-playbook playbook.yml
,我收到這樣的:
error: ERROR! Syntax Error while loading YAML.
The error appears to have been in '/etc/ansible/playbook.yml': line 3, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- hosts: example
tasks:
^ here
我試圖用空白,並重新安排搞亂事情,但我仍然收到這個錯誤。我相信這是我在這裏想念的小事,但它卻讓我無法接受!任何幫助,將不勝感激!非常感謝。
非常感謝。它爲我工作..問題是與空白! –