I'm trying to use the expect modules but only getting error

> ansible-playbook -vv --syntax-check passwd.yml

ERROR! 'expect' is not a valid attribute for a Play

The error appears to have been in 
'/home/users/.local/ansible/playbooks/passwd.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- hosts: all
  ^ here

my playbook contain:

---
- hosts: all
  remote_user: admin
  become: yes
  gather_facts: no
  tasks:
  - name: "test"
  expect:
    command: passwd username
    responses:
      (?i)password: "MySekretPa$$word"

note: this just a test not my actual password/username

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1f08a99a-0b80-4fbc-97e6-91beae93d495%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to