Skip to content

Instantly share code, notes, and snippets.

@zzondlo
Forked from jtimberman/gist:1051513
Created April 3, 2012 01:01
Show Gist options
  • Select an option

  • Save zzondlo/2288462 to your computer and use it in GitHub Desktop.

Select an option

Save zzondlo/2288462 to your computer and use it in GitHub Desktop.
use run context in a recipe
ruby_block "config file" do
block do
run_context = Chef::RunContext.new(node, {})
r = Chef::Resource::File.new("#{node[:wordpress][:dir]}/wp-config.php", run_context)
r.content(IO.read("#{node[:wordpress][:dir]}/wp-config-sample.php"))
r.owner("root")
r.group("root")
r.mode("0644")
r.run_action(:create)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment