删除文件时出现Ansible错误(此模块需要key = value参数)

时间:2016-05-10 09:56:06

标签: ansible ansible-playbook

当我尝试删除文件时出现以下错误:

TASK: [mulecore | Delete the anchor.txt file] ********************************* 
failed:  => {"failed": true}
msg: this module requires key=value arguments (['the_file.stdout', 'state-absent'])

FATAL: all hosts have already failed -- aborting

这是我的任务:

- file: the_file.stdout state = absent

1 个答案:

答案 0 :(得分:1)

您必须将文件标记为路径参数:

- file: path=the_file.stdout state=absent