Skip to content
Ryota Arai edited this page Dec 1, 2015 · 4 revisions

Itamae has Chef-like definitions feature.

You can define definition with a collection of multiple resources, like:

define :install_and_enable_package, version: nil do
  package params[:name] do
    version params[:version] if params[:version]
    action :install
  end

  service params[:name] do
    action :enable
  end
end

Then, you can use it:

install_and_enable_package 'nginx' do
  version '1.6.1'
end

Note that a define should be done before using the defined resource.