diff options
author | Micah Anderson <micah@riseup.net> | 2011-03-25 00:59:48 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2011-03-25 00:59:48 -0400 |
commit | 233229435f4dacc5c1f14e1756b0d5810448f00c (patch) | |
tree | 142bda5632e2f0084cb64f8f8c5ab130623e5870 | |
parent | ab9bc25704ac0c560cc8f11ae6ef67402cde3830 (diff) | |
parent | 46baf4a692932482cac32eff91d49de461411bac (diff) | |
download | puppet-common-233229435f4dacc5c1f14e1756b0d5810448f00c.tar.gz puppet-common-233229435f4dacc5c1f14e1756b0d5810448f00c.tar.bz2 |
Merge remote-tracking branch 'sarava/master'
Conflicts:
manifests/defines/line.pp
manifests/defines/module_dir.pp
manifests/defines/module_file.pp
manifests/init.pp
-rw-r--r-- | manifests/defines/delete_lines.pp | 5 | ||||
-rw-r--r-- | manifests/defines/line.pp | 15 | ||||
-rw-r--r-- | manifests/defines/module_file.pp | 8 |
3 files changed, 17 insertions, 11 deletions
diff --git a/manifests/defines/delete_lines.pp b/manifests/defines/delete_lines.pp new file mode 100644 index 0000000..28d2362 --- /dev/null +++ b/manifests/defines/delete_lines.pp @@ -0,0 +1,5 @@ +define delete_lines($file, $pattern) { + exec { "/bin/sed -i -r -e '/$pattern/d' $file": + onlyif => "/bin/grep -E '$pattern' '$file'", + } +} diff --git a/manifests/defines/line.pp b/manifests/defines/line.pp index ccfa357..bbe0a54 100644 --- a/manifests/defines/line.pp +++ b/manifests/defines/line.pp @@ -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') { } } } - - diff --git a/manifests/defines/module_file.pp b/manifests/defines/module_file.pp index 70e5cbf..5977b2d 100644 --- a/manifests/defines/module_file.pp +++ b/manifests/defines/module_file.pp @@ -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 } } |