Home

Awesome

:sushi: mitamae Latest Version Build Status

mitamae is a tool to automate configuration management using a Chef-like DSL powered by mruby.

It's been used for provisioning servers, e.g. RubyCI servers and Ruby's git server, and setting up local environments with dotfiles.

Key Features

Installation

Download a binary for your platform from GitHub Releases.

curl -L https://github.com/itamae-kitchen/mitamae/releases/latest/download/mitamae-x86_64-linux.tar.gz \
  | tar xvz
./mitamae-x86_64-linux help

Getting Started

Create a recipe file as recipe.rb:

package 'nginx' do
  action :install
end

service 'nginx' do
  action [:enable, :start]
end

And then execute mitamae local command to apply a recipe to a local machine.

$ mv mitamae-x86_64-linux mitamae
$ ./mitamae local recipe.rb
 INFO : Starting mitamae...
 INFO : Recipe: /home/user/recipe.rb
 INFO :   package[nginx] installed will change from 'false' to 'true'
 INFO :   service[nginx] enabled will change from 'false' to 'true'
 INFO :   service[nginx] running will change from 'false' to 'true'

See mitamae help local for available options. --log-level=debug is helpful to inspect what's executed in detail.

Documentation

mitamae was built as an alternative implementation of Itamae. Therefore you may refer to resources related to Itamae for mitamae as well.

How to write recipes

Please refer to Itamae wiki:

mitamae's original features

They should be ported to Itamae at some point.

Plugins

Please see PLUGINS.md for how to install or create plugins for mitamae.

Find mitamae plugins and Itamae plugins supporting mitamae on GitHub.

mruby features

The DSL is based on mruby instead of standard Ruby unlike Chef and Itamae. You may use the following mruby features in mitamae recipes.

Supported platforms

Running mitamae on servers

When you want to use mitamae on remote servers, you need to distribute a mitamae binary and recipes to the servers and run them remotely. There are at least the following ways to do it:

Example recipes

The following recipes are open-source usages of mitamae.

Migrating from Chef

While the DSL is inspired by Chef, there are some differences you need to keep in mind when you migrate Chef recipes to mitamae recipes.

Chefmitamae
cookbook_fileUse remote_file or template, specifying a path with source.
directory's recursive truedirectory is recursive true by default
ruby_blockUse local_ruby_block.
shell_out!Use run_command. Open3.capture3 or system might suffice too.
Chef::Log.*MItamae.logger.*
Digest::*.hexdigestUse *sum command (e.g. sha1sum) as a workaround.
bashJust use execute or specify bash -c ... with it. <br> mitamae's --shell=/bin/bash might also help.
cronYou may use mitamae-plugin-resource-cron.
deploy_revisionYou may use mitamae-plugin-resource-deploy_revision. <br> See also: mitamae-plugin-resource-deploy_directory
runit_serviceYou may use mitamae-plugin-resource-runit_service.

Change Log

See CHANGELOG.md.

Contributing

When you develop your local changes, you can write an integration test under spec/ and run it like:

bundle install
bundle exec rake test:integration

This requires Docker on your local environment.

License

MIT License