Skip to content

Instantly share code, notes, and snippets.

@j05h
Forked from retr0h/gist:3803315
Created September 29, 2012 13:21
Show Gist options
  • Save j05h/3803996 to your computer and use it in GitHub Desktop.
Save j05h/3803996 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