mitamae is a tool to automate configuration management using a Chef-like DSL powered by mruby.
Fast - mitamae is optimized for local execution. It uses C functions via mruby libraries for core operations where possible, instead of executing commands on a shell or over a SSH connection like other tools, which is very slow.
Simple - Running mitamae doesn't require Chef Server, Berkshelf, Data Bags, or even RubyGems. The mitamae core provides only essential features. You can quickly be a master of mitamae.
Single Binary - mitamae can be deployed by just transferring a single binary to servers. You don't need to rely on slow operations over a SSH connection to workaround deployment problems.
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
Create a recipe file as
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'
mitamae help local for available options.
--log-level=debug is helpful to inspect what's executed in detail.
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:
- Including Recipes
- Node Attributes
- Host Inventory
mitamae's original features
They should be ported to Itamae at some point.
only_ifcan take a block instead of a command
run_commandstreams log output with
Please see PLUGINS.md for how to install or create plugins for mitamae.
The DSL is based on mruby instead of standard Ruby unlike Chef and Itamae. You may use the following mruby features in mitamae recipes.
- mruby's built-in features
- See Releases for supported architectures.
- All operating systems supported by Serverspec are supported since they share their underlying library, Specinfra.
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:
- rsync and ssh -
It's handy to send them using
rsyncand run them using
sshwhen you apply recipes to a few servers. hocho is a convenient tool to do this. While it's over a SSH connection, it's much faster than other tools which establish a SSH connection for each operation like
- deployment tool - A more scalable way is to install an agent to each server and notify the agents to fetch mitamae and recipes from an object storage and run them. Deployment tools like AWS CodeDeploy are useful to achieve them.
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.
||You may use mitamae-plugin-resource-cron.|
||You may use mitamae-plugin-resource-deploy_revision.
See also: mitamae-plugin-resource-deploy_directory
||You may use mitamae-plugin-resource-runit_service.|
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.