3 ms·
Portability is pretty important in the deployment/automation space and it's hard to beat bash in that capacity. It just sucks that bash sucks so much.
by klysm 7y ago
Portability is pretty important in the deployment/automation space and it's hard to beat bash in that capacity. It just sucks that bash sucks so much.
- yjftsjthsd-h 7y agoAnsible already is pretty portable/flexible on target systems (the joys of being agentless and working mostly over SSH). You tend to need python and sometimes some specific modules (python-apt, for instance) on the target, but that's hardly a burden.
- gautamdivgi 7y agoI think the Ansible modules can be executable binaries as well. I have heard of modules written in go.
- yjftsjthsd-h 7y agoHaving written Ansible modules in POSIX sh, I can assure you that this is absolutely the case:) Internally, Ansible modules are just normal executables that expect a very specific set of parameters and return a very specific JSON-encoded format. I believe there's also a newer pure-Python API, but I ignored it after realizing that it was much easier to just use the old one. (... and, of course, I really enjoyed the notion of writing a module in shell)
- stevekemp 7y agoAgreed. Ansible works, but it works so very slowly because it zips and transfers scripts/binaries over to the remote host without caching. I hacked up a simple system, in golang, which uses and SSH connection to run commands and transfer files. Of course I simplified the problem to only really uploading files, running commands, and simple template expansion. For a lot of services where you just need to download a binary and configure a config-file it works well but it's nowhere near as useful as Ansible's module system: https://github.com/skx/deployr/ https://github.com/skx/deployr/
- MichaelMoser123 7y agobash 4.3 introduced a lot of changes (like addition of declare -n); there are many versions of bash, so it's not something set in stone. https://lists.gnu.org/archive/html/info-gnu/2016-09/msg00012.html https://lists.gnu.org/archive/html/info-gnu/2016-09/msg00012...
- fulafel 7y agoIt's not so cut and dried, eg OS X ships with an ancient bash that's missing many features, and of course many operating systems (eg BSDs, Windows) and Linux distributions don't include bash by default.