Skip to content

Instantly share code, notes, and snippets.

@seancribbs
Created May 16, 2009 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seancribbs/112545 to your computer and use it in GitHub Desktop.
Save seancribbs/112545 to your computer and use it in GitHub Desktop.
Sketch of what a Chef recipe might look like in Erlang. But it should never happen.
#remote_file{
name="/usr/local/src/ruby-enterprise-1.8.6-20090421.tar.gz",
url="http://rubyforge.org/frs/download.php/55511/ruby-enterprise-1.8.6-20090421.tar.gz",
not_if=fun() -> filelib:is_file("/usr/local/src/ruby-enterprise.tar.gz") end
},
#execute{
name="expand REE tarball",
command="tar xzf ruby-enterprise-1.8.6-20090421.tar.gz",
pwd="/usr/local/src",
not_if=fun() -> filelib:is_dir("/usr/local/src/ruby-enterprise-1.8.6-20090421") end
},
#execute{
name="Install REE",
command="./installer --auto=/usr/local && echo '1.8.6-20090421' > /etc/ruby-enterprise-version",
pwd="/usr/local",
not_if=fun() ->
filelib:is_file("/etc/ruby-enterprise-version") andalso
file:read_file("/etc/ruby-enterprise-edition") =:= {ok, <<"1.8.6-20090421">>}
end
}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment