Today I learned via Tristan (link to Twitter removed) about a library which is able to read and write Ansible vault files. I had a quick look because this might come in handy.
This is not an official Ansible project, according to the project page, but it appears to do its job: