refactor modules_dir and modules_file to remove plural (deprecated in David Schmitt...
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Fri, 7 May 2010 21:13:48 +0000 (17:13 -0400)
committerMicah Anderson <micah@riseup.net>
Thu, 2 Sep 2010 22:26:50 +0000 (18:26 -0400)
manifests/defines/module_dir.pp [moved from manifests/defines/modules_dir.pp with 86% similarity]
manifests/defines/module_file.pp [new file with mode: 0644]
manifests/defines/modules_file.pp [deleted file]

similarity index 86%
rename from manifests/defines/modules_dir.pp
rename to manifests/defines/module_dir.pp
index 02398ea..73f5d75 100644 (file)
@@ -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 (file)
index 0000000..3c436ef
--- /dev/null
@@ -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 (file)
index 6a37242..0000000
+++ /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;
-       }
-}