from Hacker News

BashBooster – simple provisioning, bash only, requires nothing

by kmmbvnr_ on 9/20/14, 9:03 AM with 32 comments

  • by aleem on 9/20/14, 5:16 PM

    I used Ansible and got up and running in 2 days. But for whatever reason, I decided bash was better because it was more portable, had fewer dependencies and frankly, how hard could it be to write bash routines to download files, unpack them, install packages, etc. Besides, bash skills are more transferrable.

    After 3 weeks or labouring and using FSS with a fully working system, I dropped it all and went back to Ansible. I don't regret the time spent because I picked up a lot of transferrable skills from command line utilities and bash.

    There are simple things like downloading a file which BashBooster gets wrong. If the file already exists, it should not abort, it should resume download or compare file sizes to ensure that the previous download didn't terminate abruptly. Basically, this and other idempotency issues need to be dealt with very carefully. Even simple things like "mkdir -p foo" instead of just "mkdir foo".

    Once you get past idempotency you will most likely run into performance issues and then into project velocity.

    If you really must use Bash Scripts, I would suggest using them via Ansible's Shell + Command modules. This will allow you to lean on Ansible until your Bash scripts can catch up. It will also give you Ansible's inventory management features.

  • by zwischenzug on 9/20/14, 5:57 PM

    A similar project designed for complex docker builds designed by me :)

    http://ianmiell.github.io/shutit/

    https://github.com/ianmiell/shutit

    Used extensively within our corp for container builds, but easily repurposed for straightforward shell provisioning. Bash within a build-friendly python framework.

    I talk about it more here:

    https://www.youtube.com/watch?v=zVUPmmUU3yY

    tho slightly out of date.

    Some blogging on it here:

    http://zwischenzugs.wordpress.com/

  • by linguafranca on 9/20/14, 2:23 PM

    This reminds me of fucking_shell_scripts[1] but this looks a lot simpler and less angry. I love the idea of truly having no dependencies, since I thought f_s_s was actually written in Bash but turns out to be written in Ruby. BashBooster on the other hand just relies on Bash (no gems, no Ruby) and looks easy to set up. I will definitely be trying it out.

    [1]: https://github.com/brandonhilkert/fucking_shell_scripts

    EDIT: BashBooster says it's developed to be used with Vagrant, whereas f_s_s is stand-alone. So it doesn't quite require nothing.

  • by zenojevski on 9/20/14, 10:46 AM

    That's a very peculiar way to do unit testing, comparing the output of the whole test instead of specific asserts.

    How would you compare this with something like Shunit2[1]?

    I can see someone missing some error confirmations by being careless when producing the output or testing things in isolation.

    But I can also see how this could be more likely to catch some side effects (stupid example: unclosed terminal escapes) in combined output.

    I was looking for a nice testing tool for my bash migration tool[2], and while the `assert` way is well known, I like writing bash because it's bare and requires discipline and yours seems survivalist enough.

    [1]: https://code.google.com/p/shunit2/ [2]: https://github.com/zenoamaro/rash

  • by krick on 9/20/14, 8:10 PM

    I'm not really in charge of managing companies infrastructure, so it doesn't stand so important for me, but every time I run across talking about all these provisioning tools, I'm taken aback by how many of them are there. Ansible, Puppet, Chef, now this BashBooster. All of them written in different languages, having different syntax and all doing basically the same thing — the same thing I'm using a couple of bash-scripts for when I need to set up another server or VM!

    Yet all projects are alive yet, so there probably is some difference which makes all tools applicable. So it makes me feel uncomfortable asking this obviously nonsensical question, but: is there some one tool I should chose if I want to get away from the stone age of using bash scripts for provisioning?

  • by Firefishy on 9/20/14, 12:31 PM

    Ansible is a great alternative to Chef/Puppet etc. Agentless and runs over ssh.
  • by sandis on 9/20/14, 5:16 PM

    Yet it's a Mercurial repo. Not a big deal and I have nothing against Mercurial, but something that's marketed with "no dependencies" would be better off if it was on Git - way more accessible.
  • by zobzu on 9/20/14, 7:19 PM

    The number of attempts to fix provisioning is overwhelming. Shows that chef/puppet aren't cutting it, and neither are the smaller alternatives.
  • by millettjon on 9/20/14, 6:19 PM

    I build a similar library that does exactly this and have used it internally for a couple of years. The approach complements ansible quite nicely. For simple setups it is easier to read and modify. It is also less learning curve for the other developers.
  • by diff_sky on 9/20/14, 3:34 PM

    I recently started using bork[1] which is a bash-based DSL with a similar philosophy. Folks interested in BashBooster should also check it out.

    [1]: https://github.com/mattly/bork

  • by AndrewVos on 9/20/14, 11:20 AM

    Same sort of thing that I've been deploying everything with. http://github.com/AndrewVos/garrison
  • by captn3m0 on 9/20/14, 11:57 AM

    Something similar from visionmedia (written in go): https://github.com/visionmedia/stack
  • by gpapilion on 9/20/14, 5:37 PM

    This isn't very abstracted from running the commands directly. For example the package management differs for yum and apt. I do appreciate simplicity though.
  • by uggedal on 9/20/14, 6:10 PM

    Reminds me of my POSIX shell configuration management thingy: http://git.uggedal.com/conf
  • by Fizzadar on 9/20/14, 10:40 AM

    I've thought about doing similar things in the past (I like the idea of deploying with bash/extended-bash) - great to see this!
  • by ape4 on 9/20/14, 8:25 PM

    I looked at the code for bb-sync(). I just used cp and touch. Would be cool if it checked for rsync and used it.
  • by neilellis on 9/20/14, 1:30 PM

    Nice toolkit, will be using, thanks!