more BSD compatability from admin@immerda.ch

This commit is contained in:
David Schmitt 2008-02-14 18:24:44 +01:00
parent ffa7b203c0
commit f1428f324a
5 changed files with 11 additions and 10 deletions

View file

@ -19,7 +19,7 @@ define concatenated_file (
$header = '',
# a file with content to append
$footer = '',
$mode = 0644, $owner = root, $group = root
$mode = 0644, $owner = root, $group = 0
)
{
@ -70,7 +70,7 @@ define concatenated_file (
# The file can be referenced as File["cf_part_${name}"]
define concatenated_file_part (
$dir, $content = '', $ensure = present,
$mode = 0644, $owner = root, $group = root
$mode = 0644, $owner = root, $group = 0
)
{

View file

@ -33,7 +33,7 @@ define config_file ($content = '', $source = '', $ensure = 'present') {
# keep old versions on the server
backup => server,
# default permissions for config files
mode => 0644, owner => root, group => root,
mode => 0644, owner => root, group => 0,
# really detect changes to this file
checksum => md5,
}

View file

@ -27,13 +27,13 @@ define line($file, $line, $ensure = 'present') {
case $ensure {
default : { err ( "unknown ensure value '${ensure}'" ) }
present: {
exec { "/bin/echo '${line}' >> '${file}'":
unless => "/bin/grep -qFx '${line}' '${file}'"
exec { "echo '${line}' >> '${file}'":
unless => "grep -qFx '${line}' '${file}'"
}
}
absent: {
exec { "/usr/bin/perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'":
onlyif => "/bin/grep -qFx '${line}' '${file}'"
exec { "perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'":
onlyif => "grep -qFx '${line}' '${file}'"
}
}
}

View file

@ -7,7 +7,7 @@
# Usage:
# modules_dir { ["common", "common/dir1", "common/dir2" ]: }
define modules_dir (
$mode = 0644, $owner = root, $group = root
$mode = 0644, $owner = root, $group = 0
)
{
$dir = "/var/lib/puppet/modules/${name}"
@ -18,7 +18,7 @@ define modules_dir (
"/var/lib/puppet/modules/${name}":
# workaround
#source => [ "puppet://$servername/${name}/modules_dir", "puppet://$servername/common/empty"],
source => "puppet://$servername/files/empty",
source => "puppet://$servername/common/empty",
checksum => mtime,
recurse => true, purge => true, force => true,
mode => $mode, owner => $owner, group => $group;

View file

@ -8,8 +8,9 @@ file {
"/var/lib/puppet/modules":
ensure => directory,
source => "puppet://$servername/common/modules/",
ignore => ".svn",
recurse => true, purge => true, force => true,
mode => 0755, owner => root, group => root;
mode => 0755, owner => root, group => 0;
}
import "defines/*.pp"