Skip to content

Instantly share code, notes, and snippets.

@retr0h
Created September 29, 2012 05:57
Show Gist options
  • Save retr0h/3803315 to your computer and use it in GitHub Desktop.
Save retr0h/3803315 to your computer and use it in GitHub Desktop.
Array.new.tap do |a|
# Break the directory into pieces for recursive creation.
# ["/opt", "MegaRAID", "MegaCli"]
parts = node['megaraidcli']['dir'].scan(/^\/(?:[a-zA-Z]+)|(?:[a-zA-Z]+)/)
parts.each do |parts|
a << parts
directory a.join(::File::SEPARATOR) do
owner "root"
group "root"
mode 00775
recursive true
action :create
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment