diff options
author | mh <mh@immerda.ch> | 2013-01-03 16:49:04 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-01-03 16:49:04 +0100 |
commit | 47c385f4794fae0257dd3ab85b637eca93ee38ec (patch) | |
tree | 57a9f8bdd0ad2a492b8a5566173620986d67edef /manifests/module_file.pp | |
parent | 50a1943175bd203116d100eb5cf4f01f2fc6ded1 (diff) | |
download | puppet-common-47c385f4794fae0257dd3ab85b637eca93ee38ec.tar.gz puppet-common-47c385f4794fae0257dd3ab85b637eca93ee38ec.tar.bz2 |
cleanup module to work better on newer puppet versions
Diffstat (limited to 'manifests/module_file.pp')
-rw-r--r-- | manifests/module_file.pp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/manifests/module_file.pp b/manifests/module_file.pp new file mode 100644 index 0000000..c1070bc --- /dev/null +++ b/manifests/module_file.pp @@ -0,0 +1,37 @@ +# common/manifests/module_file.pp -- use a modules_dir to store module +# specific files +# +# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> +# See LICENSE for the full license granted to you. + +# Put a file into module-local storage. +# +# Usage: +# common::module_file { "module/file": +# source => "puppet:///...", +# mode => 644, # default +# owner => root, # default +# group => 0, # default +# } +define common::module_file ( + $ensure = present, + $source = undef, + $owner = root, + $group = 0, + $mode = 0644 +){ + include common::moduledir + file { + "${common::moduledir::module_dir_path}/${name}": + ensure => $ensure, + } + + if $ensure != 'absent' { + File["${common::moduledir::module_dir_path}/${name}"]{ + source => $source, + owner => $owner, + group => $group, + mode => $mode, + } + } +} |