I did this for a while, but then went with a git approach. The problem with dotfiles in Ansible is that you have to write different scripts for different OS', you have to keep testing them e.g. in case a package name has changed. And for me personally, mostly I'm bootstrapping a new version of an OS after a clean re-install, which again can be hard to test (macOS). So for me, Ansible was way too much hassle. YMMV