Ansible Playbook: ERROR! ‘command’ is not a valid attribute for a Play [duplicate]

The problem is that without the indentation of the command line, the command directive is part of the overall play, and not the task block.
i.e. the command should be part of the task block.

---
# This playbook runs a basic DF command.

- hosts: nagios
  #remote_user: root

  tasks:
  - name: find disk space available.
    command: df -hPT

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)