Skip to content

Instantly share code, notes, and snippets.

@thekad
Created April 19, 2011 00:34
Show Gist options
  • Save thekad/926591 to your computer and use it in GitHub Desktop.
Save thekad/926591 to your computer and use it in GitHub Desktop.
$x = "/tmp/kad/is/playing/nice"
$full = ""
define mkdir_p($owner, $group, $mode) {
if $name {
$full += "/${name}"
notice("The value is: '${full}'")
file {
"$full":
ensure => directory,
owner => $owner,
group => $group,
mode => $mode;
}
}
}
$y = split($x, '/')
mkdir_p {
$y:
owner => "kad",
group => "staff",
mode => 0600;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment