【发布时间】:2016-07-28 09:22:18
【问题描述】:
新的剧本测试不起作用。 ansible 的新手,但已经阅读过文档、示例等。
怎么了 ?
ERROR! 'file' is not a valid attribute for a Play
错误似乎出现在'/home/NTNET/mresnick/testdel.yml':第 10 行第 3 列,但可能
根据确切的语法问题,位于文件中的其他位置。
违规行似乎是:
- file: "path=/tmp/{{ item }} state=absent recurse=no"
^ here
---
- name: test playbooktestdel
- hosts: temp3
tasks:
- name: "delete old files Aveksa"
- file: path=/tmp/{{ item }} state=absent recurse=no
with_items:
- { Aveksa.tar }
- { sudo_commands }
- { baz }
...
【问题讨论】:
-
yml 的更正副本:--- - 名称:测试 playbooktestdel - 主机:temp3 任务:- 名称:“删除旧文件 Aveksa” - 文件:路径=/tmp/{{ item }} 状态=absent recurse=no with_items: - { Aveksa.tar } - { sudo_commands } - { baz } ...
标签: ansible