22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'manifests/common_directory.pp', line 22
define storm::common_directory (
String $path,
String $owner = 'storm',
String $group = 'storm',
String $permissions = '755',
Boolean $recurse = false,
) {
exec { "mkdir_${title}":
command => "/bin/mkdir -p ${path}",
unless => "/bin/test -d ${path}",
creates => $path,
}
$opt = $recurse ? {
true => '-R',
default => '',
}
exec { "chown_${title}":
command => "/bin/chown ${opt} ${owner}:${group} ${path}",
require => Exec["mkdir_${title}"],
}
exec { "chmod_${title}":
command => "/bin/chmod ${$permissions} ${path}",
require => Exec["chown_${title}"],
}
}
|