aboutsummaryrefslogtreecommitdiff
path: root/manifests/defines/module_file.pp
blob: 43b3c48c8904d0106a85d510f95579f4da0667bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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:///...",
#     mode   => 644,   # default
#     owner  => root,  # default
#     group  => 0,     # default
# }
define module_file (
	$source,
	$ensure = present,
	$alias = undef,
	$mode = 0644, $owner = root, $group = 0
    )
{
    include common::moduledir
    file {
        "${common::moduledir::module_dir_path}/${name}":
            source => $source,
            ensure => $ensure,
            alias => $alias,
            mode => $mode, owner => $owner, group => $group;
    }
}

# alias for compatibility
define modules_file (
    $source,
	  $ensure = present,
	  $alias = undef,
    $mode = 0644, $owner = root, $group = 0
  )
{
  module_file { $name:
      source => $source,
      ensure => $ensure,
      alias => $alias,
      mode => $mode, owner => $owner, group => $group
      }
}