aboutsummaryrefslogtreecommitdiff
path: root/manifests/defines/modules_dir.pp
blob: 071fc56275de8d3e79d114f3d81aa518c459760a (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
# common/manifests/defines/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.

# Usage:
# modules_dir { ["common", "common/dir1", "common/dir2" ]: }
define modules_dir (
		$mode = 0644, $owner = root, $group = 0
	)
{
	$dir = "/var/lib/puppet/modules/${name}"
	if defined(File[$dir]) {
		debug("${dir} already defined")
	} else {
		file {
			"/var/lib/puppet/modules/${name}":
				source => [ "puppet://$server/modules/${name}/modules_dir", "puppet://$server/modules/common/empty"],
				checksum => mtime,
				# ignore the placeholder
				ignore => '\.ignore', 
				recurse => true, purge => true, force => true,
				mode => $mode, owner => $owner, group => $group;
		}
	}
}