重庆思庄Oracle、Redhat认证学习论坛

标题: 检测playbook语法出现的错误 [打印本页]

作者: mahan    时间: 2021-12-5 15:09
标题: 检测playbook语法出现的错误
ERROR! 'yum' is not a valid attribute for a Play

The error appears to have been in ;home/grep/ansible/roles/apache/tasks/main.yum' :  Line 2, column 3, but may be elsewhere in the file depending on the exact syyntax problem.

在roles/apache/tasks/里用 --syntax-check 检查yum语法出现这个报错。

解决办法:
  在ansible里写一个调用apache的playbook

---
- name: use apache
  hosts: servera
  roles:
     - name:
         - apache




欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2