generate a link

This commit is contained in:
Andreas 2009-11-18 16:53:57 +01:00 committed by Micah Anderson
parent 1b4f833b19
commit 72dcd72362

20
manifests/defines/link.pp Normal file
View file

@ -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}"
}
}
}