Chef cookbook for plenv

plenv is so cool that I'd like to use it for my personal project. Then, I have to hack up chef cookbooks for automated provisioning. I tried to write Chef LWRPs for the first time.

Using the cookbook, you can easily install perls via plenv and CPAN modules via cpanm.

I'm waiting for your feedback.

Usage

Using Attributes and Recipes

Add these recipes below into run_list:

recipe[plenv]
recipe[plenv::install]
recipe[plenv::global]
recipe[plenv::cpanm]

Then set attributes described later.

Using LWRPs (Recommended)

Only recipe[plenv] should be added into your run_list.

recipe[plenv]

Then use LWRPs in your own recipe.

plenv_install "5.16.3" do
  user   "kentaro"
  action :install
end

plenv_global "5.16.3" do
  user   "kentaro"
  action :run
end

%w[
  carton
  Plack
  Amon2
].each do |mod|
  plenv_cpanm mod do
    user    "kentaro"
    version "5.16.3"
    options "--force"
    action  :install
  end
end

References for how to write LWRPs

Leave a comment

About kentaro

user-pic Running a website "PrePAN" (http://prepan.org/), paperboy&co., Tokyo, Japan, kentaro@twitter, kentaro@github, kentaro@PAUSE.