common: fix clash between modules_dir and concatenated_file(dir) better

This commit is contained in:
root 2007-09-26 11:57:18 +02:00
parent 67ea4bb276
commit 32b0c131ac
2 changed files with 25 additions and 12 deletions

View file

@ -23,13 +23,21 @@ define concatenated_file (
$mode = 0644, $owner = root, $group = root
)
{
if defined(File[$dir]) {
debug("${dir} already defined")
} else {
file {
$dir:
source => "puppet://$servername/common/empty",
checksum => mtime,
recurse => true, purge => true, force => true,
mode => $mode, owner => $owner, group => $group,
notify => Exec["concat_${name}"];
}
}
file {
$dir:
source => "puppet://$servername/common/empty",
checksum => mtime,
recurse => true, purge => true, force => true,
mode => $mode, owner => $owner, group => $group,
notify => Exec["concat_${name}"];
$name:
ensure => present, checksum => md5,
mode => $mode, owner => $owner, group => $group;

View file

@ -10,11 +10,16 @@ define modules_dir (
$mode = 0755, $owner = root, $group = root
)
{
file {
"/var/lib/puppet/modules/${name}":
source => [ "puppet://$servername/${name}/modules_dir", "puppet://$servername/common/empty"],
checksum => mtime,
recurse => true, purge => true, force => true,
mode => $mode, owner => $owner, group => $group;
$dir = "/var/lib/puppet/modules/${name}"
if defined(File[$dir]) {
debug("${dir} already defined")
} else {
file {
"/var/lib/puppet/modules/${name}":
source => [ "puppet://$servername/${name}/modules_dir", "puppet://$servername/common/empty"],
checksum => mtime,
recurse => true, purge => true, force => true,
mode => $mode, owner => $owner, group => $group;
}
}
}