Merge remote-tracking branch 'sarava/master'

Conflicts:
	manifests/defines/line.pp
	manifests/defines/module_dir.pp
	manifests/defines/module_file.pp
	manifests/init.pp
This commit is contained in:
Micah Anderson 2011-03-25 00:59:48 -04:00
commit 233229435f
3 changed files with 17 additions and 11 deletions

View file

@ -0,0 +1,5 @@
define delete_lines($file, $pattern) {
exec { "/bin/sed -i -r -e '/$pattern/d' $file":
onlyif => "/bin/grep -E '$pattern' '$file'",
}
}

View file

@ -14,11 +14,10 @@
# is a more stable solution with less maintenance headaches afterwards.
#
# Usage:
# line {
# description:
# file => "filename",
# line => "content",
# ensure => {absent,*present*}
# line { description:
# file => "filename",
# line => "content",
# ensure => {absent,*present*}
# }
#
# Example:
@ -34,6 +33,10 @@
# notify => Service[munin-node],
# require => Package[munin-node];
# }
#
# Code with fixes gathered at
# http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText
>>>>>>> sarava/master
define line($file, $line, $ensure = 'present') {
case $ensure {
default : { err ( "unknown ensure value '${ensure}'" ) }
@ -50,5 +53,3 @@ define line($file, $line, $ensure = 'present') {
}
}
}

View file

@ -16,7 +16,7 @@
define module_file (
$source,
$ensure = present,
$alias = undef,
$m_alias = undef,
$mode = 0644, $owner = root, $group = 0
)
{
@ -25,7 +25,7 @@ define module_file (
"${common::moduledir::module_dir_path}/${name}":
source => $source,
ensure => $ensure,
alias => $alias,
alias => $m_alias,
mode => $mode, owner => $owner, group => $group;
}
}
@ -34,14 +34,14 @@ define module_file (
define modules_file (
$source,
$ensure = present,
$alias = undef,
$m_alias = undef,
$mode = 0644, $owner = root, $group = 0
)
{
module_file { $name:
source => $source,
ensure => $ensure,
alias => $alias,
alias => $m_alias,
mode => $mode, owner => $owner, group => $group
}
}