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.
Thanks, this was exactly where i went wrong 🙂
Are you sure it was quotes and not the lack of a space between the colon and the data?
No.
Totally correct
I ran into this issue when running an older version of ansible (1.6-ish). Upgraded to 1.9.4 and everything worked!
That’s good to know. Thanks.
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