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:
commit
233229435f
3 changed files with 17 additions and 11 deletions
5
manifests/defines/delete_lines.pp
Normal file
5
manifests/defines/delete_lines.pp
Normal 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'",
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,11 +14,10 @@
|
||||||
# is a more stable solution with less maintenance headaches afterwards.
|
# is a more stable solution with less maintenance headaches afterwards.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# line {
|
# line { description:
|
||||||
# description:
|
# file => "filename",
|
||||||
# file => "filename",
|
# line => "content",
|
||||||
# line => "content",
|
# ensure => {absent,*present*}
|
||||||
# ensure => {absent,*present*}
|
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
|
@ -34,6 +33,10 @@
|
||||||
# notify => Service[munin-node],
|
# notify => Service[munin-node],
|
||||||
# require => Package[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') {
|
define line($file, $line, $ensure = 'present') {
|
||||||
case $ensure {
|
case $ensure {
|
||||||
default : { err ( "unknown ensure value '${ensure}'" ) }
|
default : { err ( "unknown ensure value '${ensure}'" ) }
|
||||||
|
@ -50,5 +53,3 @@ define line($file, $line, $ensure = 'present') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
define module_file (
|
define module_file (
|
||||||
$source,
|
$source,
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
$alias = undef,
|
$m_alias = undef,
|
||||||
$mode = 0644, $owner = root, $group = 0
|
$mode = 0644, $owner = root, $group = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ define module_file (
|
||||||
"${common::moduledir::module_dir_path}/${name}":
|
"${common::moduledir::module_dir_path}/${name}":
|
||||||
source => $source,
|
source => $source,
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
alias => $alias,
|
alias => $m_alias,
|
||||||
mode => $mode, owner => $owner, group => $group;
|
mode => $mode, owner => $owner, group => $group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,14 +34,14 @@ define module_file (
|
||||||
define modules_file (
|
define modules_file (
|
||||||
$source,
|
$source,
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
$alias = undef,
|
$m_alias = undef,
|
||||||
$mode = 0644, $owner = root, $group = 0
|
$mode = 0644, $owner = root, $group = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
module_file { $name:
|
module_file { $name:
|
||||||
source => $source,
|
source => $source,
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
alias => $alias,
|
alias => $m_alias,
|
||||||
mode => $mode, owner => $owner, group => $group
|
mode => $mode, owner => $owner, group => $group
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue