Ansible error fatal: must be stored as a dictionary/hash

I’ve been trying to setup group_vars in Ansible. My /group_vars/all file looked like;

some_variable:"value"

When I ran my playbook it said:

Ansible error  "fatal: ...... must be stored as a dictionary/hash"

It would have been helpful if it had provided a better error message. Anyhow, basically, I had got the syntax wrong in group vars by putting “quotes” around the value:

some_variable: value 

Hope this helps someone.

6 thoughts to “Ansible error fatal: must be stored as a dictionary/hash”

  1. When Ansible hits a syntax errors reading the YAML file it gives this error. It most probably was the no space between : and the variable

    some_variable: value is with the space which is the correct YAML format

Leave a Reply