module-common/manifests/defines/module_file.pp
2010-09-02 18:28:03 -04:00

40 lines
1.1 KiB
Puppet

# common/manifests/defines/modules_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.
# Usage:
# modules_file { "module/file":
# source => "puppet://${server}/...",
# mode => 644, # default
# owner => root, # default
# group => 0, # default
# }
define module_file (
$source,
$ensure = present,
$alias = 'absent',
$mode = 0644, $owner = root, $group = 0
)
{
include common::moduledir
file {
"${common::moduledir::module_dir_path}/${name}":
source => $source,
ensure => $ensure,
mode => $mode, owner => $owner, group => $group;
}
if ($alias != 'absent') {
File["${common::moduledir::module_dir_path}/${name}"] { alias => $alias }
}
}
# alias for compatibility
define modules_file (
$source, $mode = 0644, $owner = root, $group = 0
)
{
module_file { $name: source => $source, mode => $mode, owner => $owner, group => $group }
}