This is pretty much a solved problem, albeit not yet push button simple. I see using Git for this as the classic "Only having a hammer so everything is a nail" syndrome.
Already do exactly that with Ansible.
about defining infrastructure and application code side by side.