4 ms·
Writing ansible is faster and less error prone than a bash script. It's additionally better organized and maintainable. I use it for both immutable and manual d
by alexandrerond 11y ago
Writing ansible is faster and less error prone than a bash script. It's additionally better organized and maintainable. I use it for both immutable and manual deployments.
- nikolay 11y agoTrue... if you suck at Bash.
- michaelmrose 11y agoBash unequivocally sucks this is not to say it doesn't have its uses.
- nikolay 11y agoNo, it doesn't suck more than YAML-based scripting. I write complex Bash scripts daily - if I have to write the same in, let's say, Python, it would take longer, will possibly run slower, and will definitely take longer to test. Again, Bash is a nice tool, but you need to learn it well.
- Walkman 11y agohow do you test bash scripts?
- cakeface 11y agoI've used bats[1] in the past. I also recommend the command line shellcheck[2] for linting. [1] https://github.com/sstephenson/bats https://github.com/sstephenson/bats [2] https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck
- alexandrerond 11y agoSorry but the question is not if you suck or not at bash. The issue is that there's always someone else that DOES suck at it, in unimaginable ways, and the regular guys like you and me have to deal with it. And there, Ansible helps!
- woadwarrior01 11y agoWriting bash scripts becomes a lot less error prone with shellcheck[1]. Syntastic for vim integrates well with it. [1]: https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck