summaryrefslogtreecommitdiff
path: root/manifests/module_dir.pp
blob: 2420da943d09679c72c34d1d8a9d41ef4f800286 (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
# common/manifests/modules_dir.pp -- create a default directory
# for storing module specific information
#
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
# See LICENSE for the full license granted to you.

# A module_dir is a storage place for all the stuff a module might want to
# store. According to the FHS, this should go to /var/lib. Since this is a part
# of puppet, the full path is /var/lib/puppet/modules/${name}. Every module
# should # prefix its module_dirs with its name.
#
# Usage:
# include common::moduledir
# module_dir { ["common", "common/dir1", "common/dir2" ]: }
#
# You may refer to a file in module_dir by using :
# file { "${common::moduledir::module_dir_path}/somedir/somefile": }
define common::module_dir(
  $owner = root,
  $group = 0,
  $mode = 0644
) {
  include common::moduledir
  file {
    "${common::moduledir::module_dir_path}/${name}":
      ensure    => directory,
      recurse   => true,
      purge     => true,
      force     => true,
      owner     => $owner,
      group     => $group,
      mode      => $mode;
  }
}