In normal automation, Ansible (or similar) may be prefered. However this is for use cases where your app runs across multiple hosts, and some functions need to be done on the other host.
An example is if you have something inside a KVM instance or a docker container, and you need to ssh outside of it when it boots up (or a service starts) to play with IPtables settings on the base server.
For most cases, you would use a higher level language, that has clean remote procedure execution (in modern terms, doing "curl" to a remote node.js served API). This however is when you have a need to do everything in BASH scripts.
An example is if you have something inside a KVM instance or a docker container, and you need to ssh outside of it when it boots up (or a service starts) to play with IPtables settings on the base server.
For most cases, you would use a higher level language, that has clean remote procedure execution (in modern terms, doing "curl" to a remote node.js served API). This however is when you have a need to do everything in BASH scripts.