25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'manifests/dotfile.pp', line 25
define python::dotfile (
Enum['absent', 'present'] $ensure = 'present',
Stdlib::Absolutepath $filename = $title,
String[1] $owner = 'root',
String[1] $group = 'root',
Stdlib::Filemode $mode = '0644',
Hash $config = {},
) {
$parent_dir = dirname($filename)
exec { "create ${title}'s parent dir":
command => "install -o ${owner} -g ${group} -d ${parent_dir}",
path => ['/usr/bin', '/bin', '/usr/local/bin',],
creates => $parent_dir,
}
file { $filename:
ensure => $ensure,
owner => $owner,
group => $group,
mode => $mode,
content => template("${module_name}/inifile.erb"),
require => Exec["create ${title}'s parent dir"],
}
}
|