我只是想写一个基本的剧本,并不断收到下面的错误。尝试了一吨的东西,但仍然无法解决问题。我知道这一定是语法问题,但不知道在哪里。
这是我的代码:
---
# This playbook runs a basic DF command.
- hosts: nagios
#remote_user: root
tasks:
- name: find disk space available.
command: df -hPT
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
> ERROR! 'command' is not a valid attribute for a Play
>
> The error appears to have been in '/root/playbooks/df.yml': line 4,
> column 3, but may be elsewhere in the file depending on the exact
> syntax problem.
>
> The offending line appears to be:
>
>
> - hosts: …Run Code Online (Sandbox Code Playgroud) ansible ×1