ERROR: parse error: playbooks must be formatted as a YAML list, got <type 'dict'

3,716 views
Skip to first unread message

Raj Desikavinayagompillai

unread,
Apr 27, 2015, 3:25:42 PM4/27/15
to ansible...@googlegroups.com
Hello,
I am using ansible 1.9.0.1 
I get the following error. Let me know if I am doing something incorrect.

 ansible-playbook site.yml --syntax-check


Following error occurs 


ERROR: parse error: playbooks must be formatted as a YAML list, got <type 'dict'



# site.yml file

  hosts: ansible_slaves

  user: ansible

  sudo: yes


  #Define user and password variables

  vars:

    # created with:

    password : dummyuser

    user : dummypassword


  # Define task to add user

  tasks:

    - name: add user

      action: user name={{ user }} password={{ password }} update_password=always 

                   shell=/bin/bash home=/home/{{ user }}

      tags:

        - user






Brian Coca

unread,
Apr 27, 2015, 3:28:46 PM4/27/15
to ansible...@googlegroups.com
you were missing a dash (-), see below:

# site.yml file
- hosts: ansible_slaves
user: ansible
sudo: yes

#Define user and password variables
vars:
# created with:
password : dummyuser
user : dummypassword

# Define task to add user
tasks:
- name: add user
action: user name={{ user }} password={{ password }}
update_password=always
shell=/bin/bash home=/home/{{ user }}
tags:
- user


--
Brian Coca

Raj Desikavinayagompillai

unread,
Apr 27, 2015, 3:34:04 PM4/27/15
to ansible...@googlegroups.com
Thanks Brian for the quick response. This fixed it. 
Reply all
Reply to author
Forward
0 new messages