diff --git a/manifests/defines/modules_dir.pp b/manifests/defines/module_dir.pp similarity index 86% rename from manifests/defines/modules_dir.pp rename to 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 +# 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 -# 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; - } -}