Agreed! If it’s more than a few lines I switch to something else usually Python these days.
Couple decades ago even wrote some init scripts in Perl because they needed to be complicated.
Couple decades ago even wrote some init scripts in Perl because they needed to be complicated.
Seeing that Ansible is basically a set of Python libraries that enable users to write declarative (and hopefully idempotent) scripts, it isn't a stupid question.
As a side note, Bash + Ansible tends not to be an amazing combination, unless you can write idempotent Bash scripts, IMHO. That sounds like a recipe for false safety, where you think you wrote strong automation, and someone that is used to pure Ansible will quickly realize that it does not work in specific conditions, e.g. after second time or after specific conditions are run multiple times in a row.