All Projects → benhoskings → Babushka

benhoskings / Babushka

Licence: other
Test-driven sysadmin.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Babushka

Rundeck
Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
Stars: ✭ 4,426 (+457.43%)
Mutual labels:  automation, ops
Linuxbashshellscriptforops
Linux Bash Shell Script and Python Script For Ops and Devops
Stars: ✭ 298 (-62.47%)
Mutual labels:  automation, ops
Minicron
🕰️ Monitor your cron jobs
Stars: ✭ 2,351 (+196.1%)
Mutual labels:  automation, ops
Runbook
A framework for gradual system automation
Stars: ✭ 531 (-33.12%)
Mutual labels:  automation, ops
Repeat
Cross-platform mouse/keyboard record/replay and automation hotkeys/macros creation, and more advanced automation features.
Stars: ✭ 763 (-3.9%)
Mutual labels:  automation
Debotnet
🔥🚀 Debotnet is a tiny portable tool for controlling Windows 10's many privacy-related settings and keep your personal data private.
Stars: ✭ 707 (-10.96%)
Mutual labels:  automation
Immortal
⭕ A *nix cross-platform (OS agnostic) supervisor
Stars: ✭ 701 (-11.71%)
Mutual labels:  unix
Buildxl
Microsoft Build Accelerator
Stars: ✭ 676 (-14.86%)
Mutual labels:  unix
Opscloud
运维管理平台(阿里云),自动同步阿里云配置信息,堡垒机(容器),批量运维,Kubernetes,Zabbix管理等功能
Stars: ✭ 788 (-0.76%)
Mutual labels:  ops
Cmsscan
CMS Scanner: Scan Wordpress, Drupal, Joomla, vBulletin websites for Security issues
Stars: ✭ 775 (-2.39%)
Mutual labels:  automation
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+809.45%)
Mutual labels:  unix
Diun
Receive notifications when an image is updated on a Docker registry
Stars: ✭ 704 (-11.34%)
Mutual labels:  automation
Appiumtestdistribution
A tool for running android and iOS appium tests in parallel across devices... U like it STAR it !
Stars: ✭ 764 (-3.78%)
Mutual labels:  automation
Vssh
Go Library to Execute Commands Over SSH at Scale
Stars: ✭ 707 (-10.96%)
Mutual labels:  automation
Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+806.93%)
Mutual labels:  automation
Puppeteer Api Zh cn
📖 Puppeteer中文文档(官方指定的中文文档)
Stars: ✭ 697 (-12.22%)
Mutual labels:  automation
Prefect
The easiest way to automate your data
Stars: ✭ 7,956 (+902.02%)
Mutual labels:  automation
Dumpsterfire
"Security Incidents In A Box!" A modular, menu-driven, cross-platform tool for building customized, time-delayed, distributed security events. Easily create custom event chains for Blue- & Red Team drills and sensor / alert mapping. Red Teams can create decoy incidents, distractions, and lures to support and scale their operations. Build event sequences ("narratives") to simulate realistic scenarios and generate corresponding network and filesystem artifacts.
Stars: ✭ 775 (-2.39%)
Mutual labels:  automation
Leasot
Parse and output TODOs and FIXMEs from comments in your files
Stars: ✭ 729 (-8.19%)
Mutual labels:  automation
Opsmop
DISCONTINUED: permanent copy of fork lives at github.com/mpdehaan/opsmop
Stars: ✭ 725 (-8.69%)
Mutual labels:  automation

Archived

I don't intend to do any further work on babushka (in fact I haven't done so in some time).

I had the idea and started working on the project in 2009. At the time docker and even vagrant were yet to be conceived. In part I wanted to build a simpler, small-scale alternative to the likes of chef and puppet, and in part it started as a bit of an experiment in how far I could hone a ruby DSL and to what extent I could lean on it to do useful work. I had a ball working on it and learned a hell of a lot, and I'm proud of the fact that the initial design proved sound. I'm less proud of certain parts of the implementation - hoowee would I write a few bits of that code differently today - but then we were all young once.

These days things are very different. With modern containers and the immutability they provide, along with tools like terraform, kubernetes and so on, babushka and its mutation-based approach is quite dated. In fact requiring good old babushka for serious infrastructure work today could be considered a kind of warning sign.

As for setting up a new laptop and so on, I've learned the long way that a dumb shell script that copies some preferences into place, runs a few defaults write commands, and so on, along with a few manual steps, is much easier to maintain. The more an automated process reaches into MacOS the more quickly it will fall out of compatibility, and in any case setting up a new machine is a rare enough occurrence for me that it's not worth aiming for perfect automation.

Thanks to everyone who's contributed and made use of it over the years. As always if you'd like to make use of it in any way, go for your life - I just don't intend to make any more changes to this main repo. Well maybe one rainy day I'll refactor the hairy bits - we'll see.

Cheers and all the best.


What

Babushka is a commandline tool for automating computing chores. Each distinct part of the job is expressed as a dependency (dep), which comprises a test and the code to make that test pass.

dep 'on git branch', :branch do
  met? {
    current_branch = shell('git branch').split("\n").collapse(/^\* /).first
    log "Currently on #{current_branch}."
    current_branch == branch
  }
  meet {
    log_shell("Checking out #{branch}", 'git', 'checkout', branch)
  }
end

Above is an expository dep that can achieve the modest goal of being on the correct git branch (note the parameter denoted by the :branch symbol). It's built using the two DSL words met? and meet, which contain each dep's logic, separating the test (is the dependency met?) from the code (meet the dependency).

Running this dep when a branch change is required shows how babushka does its work in blocks of met/meet/met: a failing test, an action blindly taken, and then the same test again, passing now as a result.

$ bin/babushka.rb 'on git branch' branch=stable
on git branch {
  Currently on master.
  meet {
    Checking out stable... done.
  }
  Currently on stable.
} ✓ on git branch

If we're already on the right branch, though, the initial test is already passing, and so there's no work to do.

$ bin/babushka.rb 'on git branch' branch=stable
on git branch {
  Currently on stable.
} ✓ on git branch

That's all very well for one isolated task. To achieve something bigger, tasks have to trigger other ones, which is where the third DSL word requires comes in.

dep 'on git branch', :branch do
  requires 'git'
  # ...

Before babushka processes a dep in the met/meet/met fashion described above, all its requirements are processed to completion in the same way. That reflects reality: asking if we're on the right git branch doesn't even make sense if git isn't installed.

$ bin/babushka.rb 'on git branch' branch=stable
on git branch {
  git {
    'git' runs from /usr/bin.
    ✓ git is 2.3.8, which is >= 1.6.
  } ✓ git
  Currently on stable.
} ✓ on git branch

The complentary DSL word requires_when_unmet can be used to specify dependencies required only when a given dep is found to be unmet, and that can be skipped when the dep is already met. (Build tools are a good example of such a requirement.)

There are other things to learn about, like dep templates, dep sources, and the few remaining words in babushka's DSL, but the above is the nut of it. If you string a few dozen deps like this one together, you can provision a server from scratch, or do anything else you like.

There is much more detailed documentation on the website, along with per-method documentation which can be viewed here.

Installing

Babushka is most easily installed using babushka.me/up, a shell script that installs babushka via git (and its dependencies, ruby and git, via your system's package manager if required). It's safe to run on existing systems, and intended to be used as the first shell command on a new system too. You can install babushka this way using curl or wget:

sh -c "`curl https://babushka.me/up`"

If you'd rather install manually, all you need to do is clone the git repo (or extract an archive of it) and if you like, link bin/babushka.rb into your path as 'babushka'.

Check the install documentation for details on customising the installation, including locking to specific versions and installing from forks using babushka.me/up.

Supported systems

Babushka itself should run on any Unix; there's nothing in the core of babushka that requires anything other than unix, ruby, and git.

I develop babushka on macOS and use it primarily on Ubuntu, so homebrew and apt are the best-supported package managers. There is also some yum (RedHat/Fedora/CentOS) and pacman (Arch) support, thanks to others' contributions. On other systems, specific operations (like installing a package using that system's package manager) will fail with an error message, but otherwise babushka should run fine. In any case, patches are most welcome.

Acknowledgements

Babushka takes advantage of these ruby libraries:

Thanks very much to everyone who's contributed to babushka, whether by submitting patches, discussing design ideas with me, testing, or just giving their feedback.

A list of contributors here inevitably falls out of date - the contributors page contains the full list. In addition, the version-bumping commits always detail what changed and who helped out in their commit messages.

License

Babushka is licensed under the three-clause BSD license, except for lib/levenshtein/levenshtein.rb, which is licensed under the MIT license.

The BSD license can be found in full in the LICENSE file, and the MIT license can be found at the top of lib/levenshtein/levenshtein.rb.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].