Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created June 2, 2014 10:18
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 tkuchiki/0901ae07b7b954963682 to your computer and use it in GitHub Desktop.
Save tkuchiki/0901ae07b7b954963682 to your computer and use it in GitHub Desktop.
ruby_block の中で、template resource を実行する
ruby_block "create template" do
block do
template = Chef::Resource::Template.new("/path/to/file", run_context)
template.owner "root"
template.cookbook "COOKBOOK_NAME"
template.mode 0644
template.source "conffile.erb"
template.variables({
:foo => "bar",
})
template.run_action(:create)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment