Distributed shell scripts for Christmas
When being told about the differences between Puppet and Chef by Puppet fans, a few common talking points emerged. They included the terms “DSL”, “declarative”, and “shell script”.
“Shell script” was probably the most entertaining meme, and referred to how, without dependencies, Chef was just like writing shell scripts in Ruby.
In actuality, a Chef cookbook appears to be roughly 17 files in 7 different directories. Most of them end in .rb, but there is also a metadata.json to keep the metadata.rb company, and perhaps an .rdoc if you like that sort of thing. I have no idea who writes shell scripts this way. I am also stupefied that people say this is easier than Puppet, because I doubt I would want to perform “system administration” by writing one of these things.
So when I started writing my own thing, I contemplated the dependency issue, and for a few minutes decided to be lazy and leave them out entirely. Once it dawned on me, however, that I was then writing shell scripts in Lua, I became ashamed.
If I were going to go that route, why not just set up a git repository with a bunch of shell scripts, and set up cronjobs on each of the clients to do a git pull and run these shell scripts as root? After all, nothing beats shell scripting for shell scripting, not Perl, not Python, not Ruby, and least of all Lua.
So I wrote a dependency resolver. It was easier than I had anticipated and I have vague plans to make it smarter than Puppet’s. Then I’m justified in sticking to my Lua “DSL”.
Now Steve has a list of requirements that seem to be relatively mild. I think he could easily get away with a VCS-shellscript-cron setup. The VCS pull can be tunneled over ssh or stunnel or anything else which will provide authentication and encryption, so there is no need for a fancy custom server with its own certificate authority. In short, all the tools are there and you just need glue.
I will continue to pretend that I’ll need more complex logic and power that only Lua can give me, so I’ll end up doing VCS-Lua-cron until I change my mind.