diff options
-rw-r--r-- | manifests/defines/link.pp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/defines/link.pp b/manifests/defines/link.pp new file mode 100644 index 0000000..3325e4b --- /dev/null +++ b/manifests/defines/link.pp @@ -0,0 +1,20 @@ +# common/manifests/defines/link.pp -- create a link +# +# Copyleft (C) 2009 immerdaadmin <admin@immerda.ch> +# See LICENSE for the full license granted to you. + +# Usage: +# link { "/usr/bin/convert": target => "/usr/local/bin/convert" } +# e.g. equivalent to bash# ln -s /usr/bin/convert /usr/local/bin/convert + +define link( + $target = 'absent' +) { + if ($target != 'absent') { + file { "$name": + ensure => link, + target => "${target}" + } + } +} + |