On, even better, you use a bash script or a little bit of Python.
One more reason to stay away from it. The codebase is very complex and the issues labeled "bug" count more than 18 thousands!
The language is a kludge of yaml and jinja with custom chunks of Python that is much less expressive than pure Python.
Go ahead and downvote at will.
it does not matter if the language is a “kludge” if it suits the purpose. Ansible suits a lot of purposes and is worth exploring as a free technology.
Ansible gives a framework that covers several of the gotchas your bash + python hack would run into.