when working with yaml files, indentation is crucial. You can setup vim to make it a little easier, like this:
:set ai ts=2 sw=2 expandtab
The above will set tabstop and shiftwidth to 2 spaces, and make the tab key create spaces instead of tabs. So with this config, you will type 2 spaces, whenever you press tab, just like yaml likes it.
This can of course be put in your vimrc file.