aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2010-05-07 17:13:48 -0400
committerMicah Anderson <micah@riseup.net>2010-09-02 18:26:50 -0400
commit1379f6cba15c3e76ade83e5ec4b997879d4370e7 (patch)
treee5fbe25ee48dfc32aba93b2226ae1fd84662e5a8 /manifests
parent109311524e3d63bb082b40db4caa25d650202511 (diff)
downloadpuppet-common-1379f6cba15c3e76ade83e5ec4b997879d4370e7.tar.gz
puppet-common-1379f6cba15c3e76ade83e5ec4b997879d4370e7.tar.bz2
refactor modules_dir and modules_file to remove plural (deprecated in David Schmitt's version) and adjust module_file to new module_dir structure
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines/module_dir.pp (renamed from manifests/defines/modules_dir.pp)10
-rw-r--r--manifests/defines/module_file.pp33
-rw-r--r--manifests/defines/modules_file.pp24
3 files changed, 38 insertions, 29 deletions
diff --git a/manifests/defines/modules_dir.pp b/manifests/defines/module_dir.pp
index 02398ea..73f5d75 100644
--- a/manifests/defines/modules_dir.pp
+++ b/manifests/defines/module_dir.pp
@@ -6,16 +6,16 @@
# Usage:
# include common::moduledir
-# modules_dir { ["common", "common/dir1", "common/dir2" ]: }
+# 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 modules_dir (
+define module_dir (
$mode = 0644, $owner = root, $group = 0
)
{
- include common::moduledir
+ include common::moduledir
$dir = "$common::moduledir::module_dir_path/${name}"
if defined(File[$dir]) {
debug("${dir} already defined")
@@ -33,9 +33,9 @@ define modules_dir (
}
# alias for compatibility
-define module_dir (
+define modules_dir (
$mode = 0644, $owner = root, $group = 0
)
{
- modules_dir{$name: mode => $mode, owner => $owner, group => $group }
+ module_dir { $name: mode => $mode, owner => $owner, group => $group }
}
diff --git a/manifests/defines/module_file.pp b/manifests/defines/module_file.pp
new file mode 100644
index 0000000..3c436ef
--- /dev/null
+++ b/manifests/defines/module_file.pp
@@ -0,0 +1,33 @@
+# 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,
+ $mode = 0644, $owner = root, $group = 0
+ )
+{
+ include common::moduledir
+ file {
+ "${common::moduledir::module_dir_path}/${name}":
+ source => $source,
+ mode => $mode, owner => $owner, group => $group;
+ }
+}
+
+# alias for compatibility
+define modules_file (
+ $source, $mode = 0644, $owner = root, $group = 0
+ )
+{
+ module_file { $name: source => $source, mode => $mode, owner => $owner, group => $group }
+}
diff --git a/manifests/defines/modules_file.pp b/manifests/defines/modules_file.pp
deleted file mode 100644
index 6a37242..0000000
--- a/manifests/defines/modules_file.pp
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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 => root, # default
-# }
-define modules_file (
- $source,
- $mode = 0644, $owner = root, $group = root
- )
-{
- file {
- "/var/lib/puppet/modules/${name}":
- source => $source,
- mode => $mode, owner => $owner, group => $group;
- }
-}