diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-12-11 11:33:37 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-12-11 11:33:37 +0000 |
commit | 5d0f5ae981faf258f11fdbcd24bc50e1de05889a (patch) | |
tree | 3ff3994f9db76f039daf24c6a5eb631ee07f44fe /modules/mga-common | |
parent | 3c51f27dd70770263c5bd6793a41977fea86cab3 (diff) | |
download | puppet-5d0f5ae981faf258f11fdbcd24bc50e1de05889a.tar puppet-5d0f5ae981faf258f11fdbcd24bc50e1de05889a.tar.gz puppet-5d0f5ae981faf258f11fdbcd24bc50e1de05889a.tar.bz2 puppet-5d0f5ae981faf258f11fdbcd24bc50e1de05889a.tar.xz puppet-5d0f5ae981faf258f11fdbcd24bc50e1de05889a.zip |
mga-common::local_script: add $source attribute
Diffstat (limited to 'modules/mga-common')
-rw-r--r-- | modules/mga-common/manifests/local_script.pp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/mga-common/manifests/local_script.pp b/modules/mga-common/manifests/local_script.pp index 0b8f4514..213ba84e 100644 --- a/modules/mga-common/manifests/local_script.pp +++ b/modules/mga-common/manifests/local_script.pp @@ -1,11 +1,22 @@ -define mga-common::local_script($content, +define mga-common::local_script( + $content = undef, + $source = undef, $owner = 'root', $group = 'root', $mode = '0755') { - file { "/usr/local/bin/$name": + $filename = "/usr/local/bin/$name" + file { $filename: owner => $owner, group => $group, mode => $mode, - content => $content, + } + if ($source == undef) { + File[$filename] { + content => $content, + } + } else { + File[$filename] { + source => $source, + } } } |